code: public static <T> T assertNotNull(T object, String fieldName) throws IllegalArgumentException {
          if (object == null) {
              throw new IllegalArgumentException(String.format("%s cannot be null", fieldName));
          }
          return object;
      }
docs: Asserts that the given object is non-null and returns it.
  
  @param object
  Object to assert on
  @param fieldName
  Field name to display in exception message if null
  @return Object if non null
  @throws IllegalArgumentException
  If object was null