@Test
public void testIsUserCanBeRemoved() throws Exception {

  users.createUser("admin", "admin", UserType.LOCAL, true, true);
  users.createUser("admin222", "admin222", UserType.LOCAL, true, true);
  Assert.assertTrue(users.isUserCanBeRemoved(userDAO.findUserByName("admin")));
  Assert.assertTrue(users.isUserCanBeRemoved(userDAO.findUserByName("admin222")));
  users.removeUser(users.getAnyUser("admin222"));
  Assert.assertFalse(users.isUserCanBeRemoved(userDAO.findUserByName("admin")));
  users.createUser("user", "user");
  Assert.assertFalse(users.isUserCanBeRemoved(userDAO.findUserByName("admin")));
  users.createUser("admin333", "admin333", UserType.LOCAL, true, true);
  Assert.assertTrue(users.isUserCanBeRemoved(userDAO.findUserByName("admin")));
  Assert.assertTrue(users.isUserCanBeRemoved(userDAO.findUserByName("admin333")));
}