### Question:
StringCollectionUtil { public static void retainMatching(Collection<String> values, String... patterns) { retainMatching(values, Arrays.asList(patterns)); }  static void retainMatching(Collection<String> values,
      String... patterns); static void retainMatching(Collection<String> values,
      Collection<String> patterns); static void removeMatching(Collection<String> values,
      String... patterns); static void removeMatching(Collection<String> values,
      Collection<String> patterns);  }### Answer:
@Test public void testRetainMatchingWithNoPatterns() throws Exception { Collection<String> values = stringToList("A"); StringCollectionUtil.retainMatching(values); assertTrue(values.contains("A")); }
@Test public void testRetainMatchingWithMatchingPattern() throws Exception { Collection<String> values = stringToList("A"); StringCollectionUtil.retainMatching(values, "A"); assertTrue(values.contains("A")); }
@Test public void testRetainMatchingWithNoMatchingPattern() throws Exception { Collection<String> values = stringToList("A"); StringCollectionUtil.retainMatching(values, "B"); assertTrue(values.isEmpty()); }