### Question:
CollectionUtils { public static <T> List<T> filter(final Iterable<? extends T> unfiltered, final Filter<T> filter) { final List<T> filtered = new ArrayList<T>(); if (unfiltered != null) { for (final T element : unfiltered) { if (filter == null || filter.include(element)) { filtered.add(element); } } } return filtered; } private  CollectionUtils(); static List<?> arrayToList(final Object source); static List<T> filter(final Iterable<? extends T> unfiltered, final Filter<T> filter); static T firstElementOf(final Collection<? extends T> collection); static boolean isEmpty(final Collection<?> collection); static boolean isEmpty(final Map<?, ?> map); static Collection<T> populate(final Collection<T> collection,
      final Collection<? extends T> items);  }### Answer:
@Test public void testFilterNonNullIterableWithNonNullFilter() { final Iterable<String> inputs = Arrays.asList("a", "", null, "b"); final List<? extends String> results = CollectionUtils.filter(inputs, NON_BLANK_FILTER); assertEquals(Arrays.asList("a", "b"), results); }
@Test public void testFilterNonNullIterableWithNullFilter() { final Iterable<String> inputs = Arrays.asList("a", ""); final List<? extends String> results = CollectionUtils.filter(inputs, null); assertEquals(inputs, results); }
@Test public void testFilterNullCollection() { assertEquals(0, CollectionUtils.filter(null, NON_BLANK_FILTER).size()); }