Java tutorial
//package com.java2s; public class Main { public static void checkNotNull(Object o, String name) { if (o == null) throw new IllegalArgumentException(String.format("%s must be not null", name)); } }