Asserts { public static void notNull(final Object object, final String name) { if (object == null) { throw new IllegalStateException(name + " is null"); } } private  Asserts(); static void check(final boolean expression, final String message); static void check(final boolean expression, final String message, final Object... args); static void check(final boolean expression, final String message, final Object arg); static void notNull(final Object object, final String name); static void notEmpty(final CharSequence s, final String name); static void notBlank(final CharSequence s, final String name);  }
@Test(expected=IllegalStateException.class) public void testExpressionNotNullFail() { Asserts.notNull(null, "Stuff"); }