### Question:
CollectionUtils { public static <T> Collection<T> diff(Collection<T> c1, Collection<T> c2) { if (c1 == null || c1.isEmpty() || c2 == null || c2.isEmpty()) { return c1; } Collection<T> difference = new ArrayList<>(); for (T item : c1) { if (!c2.contains(item)) { difference.add(item); } } return difference; } private  CollectionUtils(); static Collection<T> diff(Collection<T> c1, Collection<T> c2); static boolean isEmpty(Collection<T> c); static boolean isEmpty(Map<K, V> m); static Dictionary<S, T> singletonDictionary(S s, T t); static Dictionary<S, T> toDictionary(Map<S, T> map);  }### Answer:
@Test public void testDiff() throws Exception { Collection<String> l1 = Arrays.asList("1", "2", "3"); Collection<String> l2 = Arrays.asList("2", "4", "5"); Collection<String> l3 = CollectionUtils.diff(l1, l2); assertEquals(2, l3.size()); assertTrue(l3.contains("1")); assertTrue(l3.contains("3")); l3 = CollectionUtils.diff(l1, null); assertEquals(3, l3.size()); assertTrue(l3.containsAll(l1)); l3 = CollectionUtils.diff(null, null); assertNull(l3); }