code: @SuppressWarnings("unchecked")
      public <X extends Collection<T>, T> X toCollection(Class<? extends Collection> collectionClass, Class<T> classOfT, String pattern) {
          if (collectionClass == null || classOfT == null) {
              return null;
          }
  
          try {
              // reflectively instantiate the target collection type using the default constructor
              Constructor<?> constructor = collectionClass.getConstructor();
              X collection = (X) constructor.newInstance();
  
              // cheat by not instantiating a ParameterValue for every value
              ParameterValue parameterValue = newParameterValuePlaceHolder();
  
              List<String> list = toList();
  
              for (String value : list) {
                  parameterValue.values[0] = value;
                  T t = (T) parameterValue.toObject(classOfT, pattern);
                  collection.add(t);
              }
  
              return collection;
          } catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException e) {
              throw new PippoRuntimeException(e, "Failed to create collection");
          }
      }
docs: Converts a string value(s) to the target collection type. You may optionally specify
  a string pattern to assist in the type conversion.
  
  @param collectionClass
  @param classOfT
  @param pattern  optional pattern for interpreting the underlying request
  string value. (used for date & time conversions)
  @return a collection of the values