Assertion { public static <T> void notNull(T argument, String format, Object... args) { if (argument == null) { throw new InvalidArgumentException(String.format(format, args) + " cannot be null"); } }  static void notNull(T argument, String format, Object... args); static void notNullOrEmpty(String argument, String name); static void negative(long number, String name); static void positive(long number, String name); static void nonNegative(long number, String name); static void nonPositive(long number, String name);  }
@Test(expected = InvalidArgumentException.class) public void notNull_withNull() throws Exception { Object obj = null; Assertion.notNull(obj, "object"); }
@Test public void notNull_ok() throws Exception { Object obj = new Object(); Assertion.notNull(obj, "object"); }