code: protected static <U> U nullCheck(U value, String message) {
          if (value == null) {
              throw new NullPointerException(message);
          }
          return value;
      }
docs: Checks if the value is null and if so, throws
  a NullPointerException with the given message.
  @param <U> the value type
  @param value the value to check for null
  @param message the message to report in the exception
  @return the value