code: @SuppressWarnings("unchecked")
      private static void setMapParam(Field field, List<?> values) {
          try {
              // Find Map method: put(Object, Object)
              Class<?> fieldClass = field.getType();
              Method addMethod = fieldClass.getMethod("put", Object.class, Object.class);
              
              // Add each map key/value to field value
              for (Object subParam : values) {
                  if (subParam instanceof Map) {
                      Map<String, ?> map = (Map<String, ?>)subParam;
                      for (String key : map.keySet()) {
                          Object value = map.get(key);
                          if (value instanceof List) {
                              // Contains a single element, which is a key/value map
                              value = ((List<?>)value).get(0);
                          }
                          addMethod.invoke(field.get(config), key, value);
                      }
                  } else {
                      throw new RuntimeException("Unexpected collection 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 Map<String, Object> configuration parameter