AssertUtil { public static void notNull(Object object, String message) { if (object == null) { throw new IllegalArgumentException(message); } } private  AssertUtil(); static void notNull(Object object, String message); static void notEmpty(Object[] array, String message); static void notEmpty(Collection<?> collection, String message); static void isTrue(boolean condition, String message);  }
@Test void notNull_test() { Object object = new Object(); AssertUtil.notNull(object, "message"); }
@Test void notNull_test_with_null() { Throwable t = assertThrows(IllegalArgumentException.class, () -> AssertUtil.notNull(null, "message") ); assertThat(t).hasMessage("message"); }