public static <T> GoConfigClassLoader<T> classParser(Element e, Class<T> aClass, ConfigCache configCache, GoCipher goCipher, final ConfigElementImplementationRegistry registry, ConfigReferenceElements configReferenceElements) {
        return new GoConfigClassLoader<>(e, aClass, configCache, goCipher, registry, configReferenceElements);
    }
@Test
    public void shouldErrorOutWhenAttributeAwareConfigTagClassHasConfigAttributeWithSameName() {
        final Element element = new Element("example");
        element.setAttribute("type", "example-type");
        when(configCache.getFieldCache()).thenReturn(new ClassAttributeCache.FieldCache());

        final GoConfigClassLoader<AttributeAwareConfigTagHasConfigAttributeWithSameName> loader = GoConfigClassLoader.classParser(element, AttributeAwareConfigTagHasConfigAttributeWithSameName.class, configCache, goCipher, registry, referenceElements);

        assertThatThrownBy(loader::parse)
                .isInstanceOf(RuntimeException.class)
                .hasMessageContaining("Attribute `type` is not allowed in com.thoughtworks.go.config.parser.AttributeAwareConfigTagHasConfigAttributeWithSameName. You cannot use @ConfigAttribute annotation with attribute name `type` when @AttributeAwareConfigTag is configured with same name.");
    }