code: public static <T> Optional<T> of(final T value) throws NullPointerException {
          if (value == null) {
              throw new NullPointerException("A null value was passed which is not allowed to be null."
                      + " Use #ofNullable(T) if the value can be null.");
          }
          return new Optional<T>(value);
      }
docs: Creates an {@link Optional} that wraps a given non-null value.
  
  @param value The value to wrap.
  @param <T> The type of the wrapped value.
  @return The optional created.
  @throws NullPointerException if the passed <code>value</code> was <code>null</code>.