Java tutorial
//package com.java2s; //License from project: Open Source License public class Main { /** * Validate given argument isn't null. * * @param arg argument to validate * @param argName name of the argument to show in error message * @throws IllegalArgumentException */ public static void notNull(Object arg, String argName) { if (arg == null) { throw new IllegalArgumentException("argument is null: " + argName); } } }