Preconditions { public static void assertNull(Object object, String message) { if (object != null) { throw new IllegalArgumentException(message); } }  static void assertNull(Object object, String message); static T assertNotNull(T object, String message); static void assertTrue(boolean argument, String message);  }
@Test public void testAssertNullPass() { String test = null; Preconditions.assertNull(test, "Unexpected failure"); }
@Test(expected = IllegalArgumentException.class) public void testAssertNullFail() { String test = "hi there"; Preconditions.assertNull(test, "expected exception"); }