// Saving the account to the Directory where the Tooter application belongs.
Directory directory = stormpath.getDirectory();
directory.createAccount(account);
if (user.getGroupUrl() != null && !user.getGroupUrl().isEmpty()) {
account.addGroup(stormpath.getDataStore().getResource(user.getGroupUrl(), Group.class));
}
user.setUserName(userName);
customerDao.saveCustomer(user);