docs: @Override
      public <T> T authenticate(LdapQuery query, String password, AuthenticatedLdapEntryContextMapper<T> mapper) {
          SearchControls searchControls = searchControlsForQuery(query, RETURN_OBJ_FLAG);
          ReturningAuthenticatedLdapEntryContext<T> mapperCallback =
                  new ReturningAuthenticatedLdapEntryContext<T>(mapper);
          CollectingAuthenticationErrorCallback errorCallback =
                  new CollectingAuthenticationErrorCallback();
  
          AuthenticationStatus authenticationStatus = authenticate(query.base(),
                  query.filter().encode(),
                  password,
                  searchControls,
                  mapperCallback,
                  errorCallback);
  
          if(errorCallback.hasError()) {
              Exception error = errorCallback.getError();
  
              if (error instanceof NamingException) {
                  throw (NamingException) error;
              } else {
                  throw new UncategorizedLdapException(error);
              }
          } else if(AuthenticationStatus.EMPTYRESULT == authenticationStatus) {
          	throw new EmptyResultDataAccessException(1);
          } else if(!authenticationStatus.isSuccess()) {
              throw new AuthenticationException();
          }
  
          return mapperCallback.collectedObject;
      }