ObjectFactory loadObjectFactory() {
        Class<? extends ObjectFactory> objectFactoryClass = options.getObjectFactoryClass();
        ClassLoader classLoader = classLoaderSupplier.get();
        ServiceLoader<ObjectFactory> loader = ServiceLoader.load(ObjectFactory.class, classLoader);
        if (objectFactoryClass == null) {
            return loadSingleObjectFactoryOrDefault(loader);
        }

        return loadSelectedObjectFactory(loader, objectFactoryClass);
    }
@Test
    void shouldLoadDefaultObjectFactoryService() {
        Options options = () -> null;
        ObjectFactoryServiceLoader loader = new ObjectFactoryServiceLoader(
            ObjectFactoryServiceLoaderTest.class::getClassLoader,
            options);
        assertThat(loader.loadObjectFactory(), instanceOf(DefaultObjectFactory.class));
    }