@Test
public void testUserMerge() throws Exception {

  User mergedUser = directory.loadUser(userName);
  Set<Role> roles = mergedUser.getRoles();
  assertTrue(roles.contains(role1));
  assertTrue(roles.contains(role2));
  assertTrue(roles.contains(role3));
  assertNotNull(mergedUser.getPassword());
  assertEquals(org.getId(), mergedUser.getOrganization().getId());
  assertEquals(userName, mergedUser.getUsername());
  assertEquals("matterhorn,test", mergedUser.getProvider());
  assertTrue(mergedUser.isManageable());
  assertTrue(((JaxbUser) mergedUser).isManageable());
}