docs: public static <T> T getConfig(ConfigPatternMatcher configPatternMatcher,
                                    Map<String, T> configs, String name,
                                    Class clazz, BiConsumer<T, String> nameSetter) {
          name = getBaseName(name);
          T config = lookupByPattern(configPatternMatcher, configs, name);
          if (config != null) {
              return config;
          }
          T defConfig = configs.get("default");
          try {
              if (defConfig == null) {
                  Constructor constructor = clazz.getDeclaredConstructor();
                  constructor.setAccessible(true);
                  defConfig = (T) constructor.newInstance();
                  nameSetter.accept(defConfig, "default");
                  configs.put("default", defConfig);
              }
              Constructor copyConstructor = clazz.getDeclaredConstructor(clazz);
              copyConstructor.setAccessible(true);
              config = (T) copyConstructor.newInstance(defConfig);
              nameSetter.accept(config, name);
              configs.put(name, config);
              return config;
          } catch (NoSuchMethodException e) {
              LOGGER.severe("Could not create class " + clazz.getName());
              assert false;
              return null;
          } catch (InstantiationException e) {
              LOGGER.severe("Could not create class " + clazz.getName());
              assert false;
              return null;
          } catch (IllegalAccessException e) {
              LOGGER.severe("Could not create class " + clazz.getName());
              assert false;
              return null;
          } catch (InvocationTargetException e) {
              LOGGER.severe("Could not create class " + clazz.getName());
              assert false;
              return null;
          }
      }