Commons Lang、Validate.notEmpty()
import java.util.*; import org.apache.commons.lang.Validate; public class C2009051900 { public static void main(String[] args) { Map m = new HashMap(); m.put("foo", 1); Validate.notEmpty(m, "foo"); m = new HashMap(); Validate.notEmpty(m, "foo"); } }
で、
Exception in thread "main" java.lang.IllegalArgumentException: foo at org.apache.commons.lang.Validate.notEmpty(Validate.java:321) at C2009051900.main(C2009051900.java:13)