### Question:
CollectionUtil { @SuppressWarnings({ "rawtypes", "unchecked" }) public static <T> Collection<T> substract(Collection<T> oldList, Collection<T> newList, java.util.Comparator comparator) { Collection<T> result = new ArrayList<T>(oldList); for (T oldValue : oldList) { for (T newValue : newList) { if (comparator.compare(oldValue, newValue) == 0) { result.remove(oldValue); } } } return result; }  @SuppressWarnings({ "rawtypes", "unchecked" }) static Collection<Pair<T, T>> intersection(
			Collection<T> oldList, Collection<T> newList,
			java.util.Comparator comparator); @SuppressWarnings({ "rawtypes", "unchecked" }) static Collection<T> substract(Collection<T> oldList,
			Collection<T> newList, java.util.Comparator comparator);  }### Answer:
@Test(groups = { "collectionUtil" }, description = "substract") public void testSubstract() throws Exception { Collection<String> a = new ArrayList<String>(); a.add("a"); a.add("b"); a.add("c"); a.add("d"); Collection<String> b = new ArrayList<String>(); b.add("a"); b.add("D"); b.add("e"); b.add("f"); Collection<String> c = CollectionUtil.substract(a, b, new StringComparator()); Assert.assertEquals(c.size(), 2, "collection size"); Assert.assertTrue(c.contains("b"), "collection should contain value"); Assert.assertTrue(c.contains("c"), "collection should contain value"); }