public static <T> Collection<T> nullToEmpty(Collection<T> collection) {
        return collection == null ? Collections.emptyList() : collection;
    }
@Test
    public void testNullToEmpty_whenNotNull() {
        List<Integer> result = asList(1, 2, 3, 4, 5);
        assertEquals(result, nullToEmpty(result));
    }