@Test public void givenCollection_whenAskIsArrayOrCollection_thenReturnTrue() { final List<String> stringsList = new ArrayList<String>(); final Set<Integer> integersSet = new HashSet<Integer>(); final Collection<Contact> contactsCollection = new ArrayList<Contact>(); assertThat(isArrayOrCollection(stringsList.getClass()), is(true)); assertThat(isArrayOrCollection(integersSet.getClass()), is(true)); assertThat(isArrayOrCollection(contactsCollection.getClass()), is(true)); }
public static boolean isArrayOrCollection(Class<?> clazz) { return clazz.isArray() || Collection.class.isAssignableFrom(clazz); }
ClassUtils { public static boolean isArrayOrCollection(Class<?> clazz) { return clazz.isArray() || Collection.class.isAssignableFrom(clazz); } }
ClassUtils { public static boolean isArrayOrCollection(Class<?> clazz) { return clazz.isArray() || Collection.class.isAssignableFrom(clazz); } private  ClassUtils(); }
ClassUtils { public static boolean isArrayOrCollection(Class<?> clazz) { return clazz.isArray() || Collection.class.isAssignableFrom(clazz); } private  ClassUtils(); static boolean isArrayOrCollection(Class<?> clazz); static Class<?> getElementsClassOf(Class<?> clazz); static boolean isVoid(Class<?> clazz); }
ClassUtils { public static boolean isArrayOrCollection(Class<?> clazz) { return clazz.isArray() || Collection.class.isAssignableFrom(clazz); } private  ClassUtils(); static boolean isArrayOrCollection(Class<?> clazz); static Class<?> getElementsClassOf(Class<?> clazz); static boolean isVoid(Class<?> clazz);  }