code: public static <T> T checkNotNull(T arg, String text) {
          if (arg == null) {
              throw new NullPointerException(text);
          }
          return arg;
      }
docs: Checks that the given argument is not null. If it is, throws {@link NullPointerException}.
  Otherwise, returns the argument.