private static String buildThrowingMethod(final Set<String> simpleNames,
                                              final Map<String, List<String>> simpleNameToFullNamesMap,
                                              final Class<? extends AbstractConfig> clazz) {
        final String simpleClassName = clazz.getSimpleName();
        // Fix the name for nested classes
        final String fullClassName = clazz.getName()
                .replace('$', '.');

        simpleNameToFullNamesMap.computeIfAbsent(simpleClassName, k -> new ArrayList<>())
                .add(fullClassName);

        String methodNameSuffix = simpleClassName;
        int i = 1;
        while (simpleNames.contains(methodNameSuffix)) {
            methodNameSuffix = simpleClassName + ++i;
        }
        if (i != 1) {
            LOGGER.warn("Simple class name {} is used by multiple classes {}, using method name suffix {}",
                    simpleClassName,
                    simpleNameToFullNamesMap.get(simpleClassName),
                    methodNameSuffix);
        }
        simpleNames.add(methodNameSuffix);

        final String template = """
                    @Generated("%s")
                    @Provides
                    @SuppressWarnings("unused")
                    %s get%s%s(
                            final ProxyConfigProvider proxyConfigProvider) {
                        throw new UnsupportedOperationException(
                                "%s cannot be injected directly. "
                                        + "Inject a config class that uses it or one of its sub-class instead.");
                    }
                """;

        return String.format(
                template,
                GenerateProxyConfigProvidersModule.class.getName(),
                fullClassName,
                methodNameSuffix,
                THROWING_METHOD_SUFFIX,
                fullClassName);

    }
IMPORTANT - This whole file is generated using
{@link %s}
DO NOT edit it directly
stroom-proxy/stroom-proxy-app/src/test/java/stroom/proxy/app/guice/GenerateProxyConfigProvidersModule.java