### Question:
TypeUtils { public static boolean isCollection(Type type) { return Collection.class.isAssignableFrom(getRawType(type)); } private  TypeUtils(); static boolean isCollection(Type type); static boolean isMap(Type type); static Type getCollectionGeneric(Type type); static Type getMapValueGeneric(Type type); static Class<?> getRawType(Type type);  }### Answer:
@Test void shouldCheckIfTypeIsCollectionWhenCollectionPassed() { Type type = org.apache.commons.lang3.reflect.TypeUtils.parameterize(List.class, String.class); boolean isCollection = TypeUtils.isCollection(type); assertThat(isCollection).isTrue(); }
@Test void shouldCheckIfTypeIsCollectionWhenNotCollectionPassed() { Type type = String.class; boolean isCollection = TypeUtils.isCollection(type); assertThat(isCollection).isFalse(); }