code: public static Class<?> getGenericTypeOfCollectionField(Field field) {
          Type genericType = field.getGenericType();
  
          if (!(genericType instanceof ParameterizedType)) {
              throw new IllegalArgumentException("Field is not a ParameterizedType.");
          }
  
          Type[] genericTypes = ((ParameterizedType) genericType).getActualTypeArguments();
  
  
          if (genericTypes.length != 1) {
              throw new IllegalArgumentException("Field does not have a single generic type.");
          }
  
          if (!(genericTypes[0] instanceof Class)) {
              throw new IllegalArgumentException("Field's generic type is not a class?");
          }
  
          return (Class<?>) genericTypes[0];
      }
docs: TODO: Add unit test