### Question:
DefaultConfigFactory implements ConfigFactory { @Override public Config create(String namespace) { DefaultConfig defaultConfig = new DefaultConfig(namespace, createLocalConfigRepository(namespace)); return defaultConfig; } DefaultConfigFactory(); @Override Config create(String namespace); @Override ConfigFile createConfigFile(String namespace, ConfigFileFormat configFileFormat);  }### Answer:
@Test public void testCreate() throws Exception { String someNamespace = "someName"; Properties someProperties = new Properties(); String someKey = "someKey"; String someValue = "someValue"; someProperties.setProperty(someKey, someValue); LocalFileConfigRepository someLocalConfigRepo = mock(LocalFileConfigRepository.class); when(someLocalConfigRepo.getConfig()).thenReturn(someProperties); doReturn(someLocalConfigRepo).when(defaultConfigFactory).createLocalConfigRepository(someNamespace); Config result = defaultConfigFactory.create(someNamespace); assertThat("DefaultConfigFactory should create DefaultConfig", result, is(instanceOf(DefaultConfig.class))); assertEquals(someValue, result.getProperty(someKey, null)); }