code: private Class<?> getUnderlyingType(final Field field) {
          if (isCollectionField(field)) {
              final ParameterizedType clazz = (ParameterizedType) (field.getGenericType());
              final Type[] genericTypes = clazz.getActualTypeArguments();
              if (genericTypes.length != 1) {
                  throw new CommandLineException.CommandLineParserInternalException("Strange collection type for field " +
                          field.getName());
              }
              return (Class) genericTypes[0];
  
          } else {
              final Class<?> type = field.getType();
              if (type == Byte.TYPE) return Byte.class;
              if (type == Short.TYPE) return Short.class;
              if (type == Integer.TYPE) return Integer.class;
              if (type == Long.TYPE) return Long.class;
              if (type == Float.TYPE) return Float.class;
              if (type == Double.TYPE) return Double.class;
              if (type == Boolean.TYPE) return Boolean.class;
  
              return type;
          }
      }
docs: Returns the type that each instance of the argument needs to be converted to. In
  the case of primitive fields it will return the wrapper type so that String
  constructors can be found.