AssertUtil { public static void notEmpty(Object[] array, String message) { if (array == null || array.length == 0) { 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 notEmpty_test_with_list() { AssertUtil.notEmpty(Collections.singletonList(new Object()), "message"); }
@Test void notEmpty_test_with_array() { AssertUtil.notEmpty(Arrays.array(new Object()), "message"); }
@Test void notEmpty_test_with_null_as_set() { Throwable t = assertThrows(IllegalArgumentException.class, () -> AssertUtil.notEmpty((Set<?>) null, "message") ); assertThat(t).hasMessage("message"); }
@Test void notEmpty_test_with_null_as_array() { Throwable t = assertThrows(IllegalArgumentException.class, () -> AssertUtil.notEmpty((Object[]) null, "message") ); assertThat(t).hasMessage("message"); }
@Test void notEmpty_test_with_empty_set() { Throwable t = assertThrows(IllegalArgumentException.class, () -> AssertUtil.notEmpty(new HashSet<>(), "message") ); assertThat(t).hasMessage("message"); }
@Test void notEmpty_test_with_empty_array() { Throwable t = assertThrows(IllegalArgumentException.class, () -> AssertUtil.notEmpty(new Object[0], "message") ); assertThat(t).hasMessage("message"); }