@Override
    public boolean addClass(final Class<?> stepClass) {
        if (stepClasses.contains(stepClass)) {
            return true;
        }
        if (injectorSourceFromProperty == null) {
            if (hasInjectorSource(stepClass)) {
                checkOnlyOneClassHasInjectorSource(stepClass);
                withInjectorSource = stepClass;
                // Eager init to allow for static binding prior to before all
                // hooks
                injector = instantiateUserSpecifiedInjectorSource(withInjectorSource).getInjector();
            }
        }
        stepClasses.add(stepClass);
        return true;
    }
@Test
    void shouldThrowExceptionIfTwoDifferentInjectorSourcesAreFound() {
        factory = new GuiceFactory();
        assertTrue(factory.addClass(YourInjectorSource.class));

        Executable testMethod = () -> factory.addClass(SecondInjectorSource.class);
        CucumberBackendException actualThrown = assertThrows(CucumberBackendException.class, testMethod);
        String exceptionMessage = String.format("" +
                "Glue class %1$s and %2$s are both implementing io.cucumber.guice.InjectorSource.\n" +
                "Please ensure only one class configures the Guice context\n" +
                "\n" +
                "By default Cucumber scans the entire classpath for context configuration.\n" +
                "You can restrict this by configuring the glue path.\n" +
                ClasspathSupport.configurationExamples(),
            SecondInjectorSource.class,
            YourInjectorSource.class);
        assertThat("Unexpected exception message", actualThrown.getMessage(), is(exceptionMessage));
    }