code: private void validateInput(AuthenticationService authenticationService, String username) throws AuthenticationException {
          if (authenticationService == null) {
              throw new AuthenticationException("authenticationService cannot be null.");
          } else if (username == null) {
              throw new AuthenticationException("username cannot be null.");
          }
      }
docs: Validate that the input parameters are not null.
  
  @param authenticationService the service to authenticate a user
  @param username the user to authenticate
  @throws AuthenticationException when either input is null