@Override
    public CucumberOptionsAnnotationParser.CucumberOptions getOptions(Class<?> clazz) {
        CucumberOptions annotation = clazz.getAnnotation(CucumberOptions.class);
        if (annotation != null) {
            return new JunitCucumberOptions(annotation);
        }
        warnWhenTestNGCucumberOptionsAreUsed(clazz);
        return null;
    }
@Test
    void testObjectFactory() {
        io.cucumber.core.options.CucumberOptionsAnnotationParser.CucumberOptions options = this.optionsProvider
                .getOptions(ClassWithCustomObjectFactory.class);
        assertNotNull(options);
        assertEquals(TestObjectFactory.class, options.objectFactory());
    }