FeatureContextFactory { public FeatureContext createContext() { return FeatureContext.Builder.fromUrl(resourceUrl).withConfig(config).build(); } FeatureContextFactory(URL resourceUrl, Configuration config); FeatureContext createContext();  }
@Test public void createContext_WithUrlAndConfig_createsNewFactoryWithBuilder() { mockStatic(FeatureContext.Builder.class); FeatureContext.Builder builder = mock(FeatureContext.Builder.class, Mockito.RETURNS_DEEP_STUBS); when(FeatureContext.Builder.fromUrl(resourceUrl)).thenReturn(builder); contextFactory.createContext(); verifyStatic(); FeatureContext.Builder.fromUrl(resourceUrl); verify(builder).withConfig(config); verify(builder.withConfig(config)).build(); }