Assert { public static void notEmptyString(String str,String message) { if(StringUtils.isEmpty(str)) { throw new IllegalArgumentException(message); } } protected  Assert(); static void notNull(Object obj, String message); static void notEmptyString(String str,String message); static void notNull(Object obj, RuntimeException exception);  }
@Test public void testNotNullString() { Assertions.assertThrows(IllegalArgumentException.class, () -> notEmptyString(null, "Message can't be null")); }
@Test public void testNotEmptyString() { Assertions.assertThrows(IllegalArgumentException.class, () -> notEmptyString("", "Message can't be null or empty")); }
@Test public void testNotNullNotEmptyString() { notEmptyString("abcd", "Message can'be null or empty"); }