if (type.isAssignableFrom(Collection.class)) {
final ParameterizedType parameterizedType = (ParameterizedType) field.getGenericType();
String clazz = null;
try {
clazz = parameterizedType.getActualTypeArguments()[0].getTypeName();
return new Pair(field.getName(), Class.forName(clazz));
} catch (ClassNotFoundException ex) {
throw new IllegalStateException("Cannot find class " + clazz, ex);
}
}
}