code: public static <T> T notNull(T obj, String name) {
          if (obj == null) {
              throw new IllegalArgumentException(name + " cannot be null");
          }
          return obj;
      }
docs: Check that a value is not null. If null throws an IllegalArgumentException.
  
  @param obj value.
  @param name parameter name for the exception message.
  @return the given value.