Java tutorial
//package com.java2s; public class Main { public static <T> T notNull(T argument, String name) { if (argument == null) { throw new IllegalArgumentException(name + " should not be null!"); } else { return argument; } } }