User larmstrong = new User("larmstrong", "pwd", "Louis", "Armstrong",
"la@foobar.com");
realm.getUsers().add(larmstrong);
// Add groups
Group employees = new Group("employees ", "All FooBar employees");
employees.getMemberUsers().add(larmstrong);
realm.getRootGroups().add(employees);
Group contractors = new Group("contractors ", "All FooBar contractors");
contractors.getMemberUsers().add(stiger);
realm.getRootGroups().add(contractors);
Group managers = new Group("managers", "All FooBar managers");
realm.getRootGroups().add(managers);
Group directors = new Group("directors ", "Top-level directors");
directors.getMemberUsers().add(larmstrong);
managers.getMemberGroups().add(directors);
Group developers = new Group("developers", "All FooBar developers");
realm.getRootGroups().add(developers);
Group engineers = new Group("engineers", "All FooBar engineers");
engineers.getMemberUsers().add(stiger);
developers.getMemberGroups().add(engineers);
// realm.map(customer1, app.getRole("user"));
realm.map(managers, app.getRole("admin"));