Assert { public static void notNull(Object obj, String message) { if (obj == null) { throw new IllegalArgumentException(message); } } protected  Assert(); static void notNull(Object obj, String message); static void notNull(Object obj, RuntimeException exeception);  }
@Test(expected = IllegalArgumentException.class) public void testNotNull1() throws Exception { notNull(null, "null object"); }
@Test(expected = IllegalStateException.class) public void testNotNull2() throws Exception { notNull(null, new IllegalStateException("null object")); }