### Question:
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);  }### Answer:
@Test public void givenSingleType_whenAskIsArrayOrCollection_thenReturnFalse() { assertThat(isArrayOrCollection(String.class), is(false)); assertThat(isArrayOrCollection(Integer.class), is(false)); assertThat(isArrayOrCollection(Contact.class), is(false)); }
@Test public void givenArray_whenAskIsArrayOrCollection_thenReturnTrue() { assertThat(isArrayOrCollection(String[].class), is(true)); assertThat(isArrayOrCollection(Integer[].class), is(true)); assertThat(isArrayOrCollection(Contact[].class), is(true)); }
@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)); }