@Override
    @SuppressWarnings("unchecked")
    public <T> T create(Class<T> extensionClass) {
        String extensionClassName = extensionClass.getName();
        ClassLoader extensionClassLoader = extensionClass.getClassLoader();

        if (!cache.containsKey(extensionClassLoader)) {
            cache.put(extensionClassLoader, new HashMap<>());
        }

        Map<String, Object> classLoaderBucket = cache.get(extensionClassLoader);

        if (classLoaderBucket.containsKey(extensionClassName)) {
            return (T) classLoaderBucket.get(extensionClassName);
        }

        T extension = super.create(extensionClass);
        if (extensionClassNames.isEmpty() || extensionClassNames.contains(extensionClassName)) {
            classLoaderBucket.put(extensionClassName, extension);
        }

        return extension;
    }
@Test
    public void create() {
        ExtensionFactory extensionFactory = new SingletonExtensionFactory(pluginManager);
        Object extensionOne = extensionFactory.create(TestExtension.class);
        Object extensionTwo = extensionFactory.create(TestExtension.class);
        assertSame(extensionOne, extensionTwo);
    }