/** * check an argument is not <tt>null</tt>. * * @param <T> the class of the value to check * @param value the value to check * @param message the error message to raise if the value is <tt>null</tt> * @return the value itself, if not <tt>null</tt> * @throws NullArgumentException if the value is <tt>null</tt> */ public static <T> T nonNullArgument(@Nullable final T value, @Nullable final Object message) { if (value == null) { throw new NullArgumentException(String.valueOf(message)); } return value; }