code: public static <T> T requireNonNull(T object, String errorMessage) {
      if (object == null) {
        throw new NullPointerException(errorMessage);
      } else {
        return object;
      }
    }
docs: Checks that the specified object reference is not null.
  
  @param object the object reference to check for nullity
  @param errorMessage detail message to be used in the event that a NullPointerException is
  thrown
  @param <T> the type of the reference
  @return object if not null