public static boolean isEmptyOrAllElementsNull(Collection<?> collection) {
        for (Object o : collection) {
            if (o != null) {
                return false;
            }
        }
        return true;
    }
@Test
    void testIsEmptyOrAllElementsNull() {
        assertThat(CollectionUtil.isEmptyOrAllElementsNull(Collections.emptyList())).isTrue();
        assertThat(CollectionUtil.isEmptyOrAllElementsNull(Collections.singletonList(null)))
                .isTrue();
        assertThat(CollectionUtil.isEmptyOrAllElementsNull(Arrays.asList(null, null))).isTrue();
        assertThat(CollectionUtil.isEmptyOrAllElementsNull(Collections.singletonList("test")))
                .isFalse();
        assertThat(CollectionUtil.isEmptyOrAllElementsNull(Arrays.asList(null, "test"))).isFalse();
        assertThat(CollectionUtil.isEmptyOrAllElementsNull(Arrays.asList("test", null))).isFalse();
        assertThat(CollectionUtil.isEmptyOrAllElementsNull(Arrays.asList(null, "test", null)))
                .isFalse();
    }