### Question:
LocalFileConfigRepository extends AbstractConfigRepository implements RepositoryChangeListener { @Override public void onRepositoryChange(String namespace, Properties newProperties) { if (newProperties.equals(m_fileProperties)) { return; } Properties newFileProperties = new Properties(); newFileProperties.putAll(newProperties); updateFileProperties(newFileProperties, m_upstream.getSourceType()); this.fireRepositoryChange(namespace, newProperties); } LocalFileConfigRepository(String namespace);  LocalFileConfigRepository(String namespace, ConfigRepository upstream); @Override Properties getConfig(); @Override void setUpstreamRepository(ConfigRepository upstreamConfigRepository); @Override ConfigSourceType getSourceType(); @Override void onRepositoryChange(String namespace, Properties newProperties);  }### Answer:
@Test public void testOnRepositoryChange() throws Exception { RepositoryChangeListener someListener = mock(RepositoryChangeListener.class); LocalFileConfigRepository localFileConfigRepository = new LocalFileConfigRepository(someNamespace, upstreamRepo); assertEquals(someSourceType, localFileConfigRepository.getSourceType()); localFileConfigRepository.setLocalCacheDir(someBaseDir, true); localFileConfigRepository.addChangeListener(someListener); localFileConfigRepository.getConfig(); Properties anotherProperties = new Properties(); anotherProperties.put("anotherKey", "anotherValue"); ConfigSourceType anotherSourceType = ConfigSourceType.NONE; when(upstreamRepo.getSourceType()).thenReturn(anotherSourceType); localFileConfigRepository.onRepositoryChange(someNamespace, anotherProperties); final ArgumentCaptor<Properties> captor = ArgumentCaptor.forClass(Properties.class); verify(someListener, times(1)).onRepositoryChange(eq(someNamespace), captor.capture()); assertEquals(anotherProperties, captor.getValue()); assertEquals(anotherSourceType, localFileConfigRepository.getSourceType()); }