public static <T> Collection<T> nullToEmpty(Collection<T> collection) {
        return collection == null ? Collections.emptyList() : collection;
    }
@Test
    public void testNullToEmpty_whenNull() {
        assertEquals(emptyList(), nullToEmpty(null));
    }