XStreamUtils { public static boolean setContainsAnyOf(Set<String> toCheck, Collection<String> possibles) { Set<String> copy = new HashSet<String>(toCheck); copy.retainAll(possibles); return copy.size() > 0; }  static String toFieldName(String xmlElementName); static String toXmlElementName(String fieldName); static Collection<String> createParentFields(Class<?> clazz, String field, String separator); static boolean setContainsAnyOf(Set<String> toCheck, Collection<String> possibles); static List<String> readResource(InputStream in); static List<Class<?>> getClasses(InputStream in);  }
@Test public void testSetContainsAnyOf() { Set<String> testSet = new HashSet<>(); testSet.add("cat"); testSet.add("dog"); testSet.add("fish"); Collection<String> searchCollection = new HashSet<String>(); searchCollection.add("horse"); assertFalse(XStreamUtils.setContainsAnyOf(testSet, searchCollection)); searchCollection.add("cat"); assertTrue(XStreamUtils.setContainsAnyOf(testSet, searchCollection)); searchCollection.clear(); searchCollection.add("fish"); assertTrue(XStreamUtils.setContainsAnyOf(testSet, searchCollection)); }