Assertion { public static void notNullOrEmpty(String argument, String name) { if (argument == null || argument.isEmpty()) { throw new InvalidArgumentException(name + " cannot be null or empty"); } }  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 notNullOrEmpty_withNull() throws Exception { String str = null; Assertion.notNullOrEmpty(str, "string"); }
@Test(expected = InvalidArgumentException.class) public void notNullOrEmpty_withEmpty() throws Exception { String str = ""; Assertion.notNullOrEmpty(str, "string"); }
@Test public void notNullOrEmpty_ok() throws Exception { String str = "hello"; Assertion.notNullOrEmpty(str, "string"); }