code: private static void setListParam(Field field, List<?> values) {
          try {
              // Find method: clear() and call it
              Class<?> fieldClass = field.getType();
              Method clearMethod = fieldClass.getMethod("clear");
              clearMethod.invoke(field.get(config));
              
              // Find List method: add(Object) 
              Method addMethod = fieldClass.getMethod("add", Object.class);
              
              // Add each map key/value to field value
              for (Object subParam : values) {
                  if (subParam instanceof String) {
                      addMethod.invoke(field.get(config), subParam);
                  } else {
                      throw new RuntimeException("Unexpected parameter type for '" + field.getName() + ":" + subParam);
                  }
              }
          } catch (NoSuchMethodException  | IllegalArgumentException | InvocationTargetException | IllegalAccessException e) {
              throw new RuntimeException("Error setting configuration parameter '" + field.getName() + "'", e);
          }
      }
docs: Set a List<String> configuration parameter