class InitService {

  public InitState setAdminUser(User adminUser, String password) throws InvalidInitStateException {
    isInitStateElseThrow(InitStateName.CREATE_USER);

    LocalUser user = ((LocalUserService) userService).createLocalUser(adminUser, false);
    passwordService.setPassword(user, password);
    adminUserService.addAdmin(createAdminUser(user));

    return nextInitState();
  }

}