@Test(expected = IllegalArgumentException.class)
  public void modifyAuthentication_local_byAdminUser_newPasswordSameAsPreviousPassword() throws AmbariException {
    // given
    UserAuthenticationEntity entity = initForModifyAuthentication();

    // when
    Users users = injector.getInstance(Users.class);

    // 1st time update for user1 from hello to hello1
    users.modifyAuthentication(entity, "admin1234", "hello1", false);

    // 2nd time update for user1 from hello1 to hello
    users.modifyAuthentication(entity, "admin1234", "hello", false);
  }
User creation should throw {@link AmbariException} in case another user exists with the same name but
different user type.
ambari-server/src/test/java/org/apache/ambari/server/security/authorization/UsersTest.java