CollectionUtils { public static boolean isSet(Class<?> aClass) { return Set.class.isAssignableFrom(aClass); } private  CollectionUtils(); static boolean isArray(Class<?> aClass); static boolean isCollection(Class<?> aClass); static boolean isList(Class<?> aClass); static boolean isSet(Class<?> aClass); static boolean isPrimitiveArray(Class<?> aClass); static int getLengthOfCollection(Object value); static Object getValueFromCollection(Object collection, int index); static Set<?> createNewSet(Class<T> destType); static Set<?> createNewSet(Class<T> destSetType, Collection<?> srcValue); static Object convertListToArray(List<T> list, Class<T> destEntryType); static List<Object> convertPrimitiveArrayToList(Object primitiveArray); static Set<E> intersection(final Set<E> set1, final Set<?> set2);  }
@Test public void testIsSet() { Object[] values = new Object[] {new TreeSet(), new HashSet(), new HashSet()}; for (int i = 0; i < values.length; i++) { assertTrue(CollectionUtils.isSet(values[i].getClass())); } }