### Question:
WikiTableConfigurationFactory implements IWikiTableConfigurationFactory { @Override public synchronized List<IWikiTableConfiguration> getConfigurations(){ List<IWikiTableConfiguration> result = new ArrayList<IWikiTableConfiguration>(); result.addAll(getBuildInConfigurations()); result.addAll(getUserSpecificConfigurations()); sortByName(result); return result; } WikiTableConfigurationFactory(); @Override synchronized List<IWikiTableConfiguration> getConfigurations(); @Override synchronized List<IWikiTableConfiguration> getUserSpecificConfigurations(); @Override synchronized List<IWikiTableConfiguration> getBuildInConfigurations(); static synchronized IWikiTableConfigurationFactory getInstance(); @Override synchronized void addBuilInConfiguration(IWikiTableConfiguration additionalBuildInConfig); @Override synchronized void replaceBuilInConfiguration(List<IWikiTableConfiguration> configurations); @Override synchronized void replaceUserSpecificConfigurations(List<IWikiTableConfiguration> config); @Override void addUserSpecificConfigurations(IWikiTableConfiguration config); synchronized void setBuildInConfigurations(List<IWikiTableConfiguration> buildInConfigurations); synchronized void setUserSpecificConfigurations(List<IWikiTableConfiguration> userSpecificConfigurations); static List<IWikiTableConfiguration> merge(List<IWikiTableConfiguration> primary, List<IWikiTableConfiguration> secondary);  }### Answer:
@Test public void testGetEmptyConfigurations() { List<IWikiTableConfiguration> configurations = classUnderTest.getConfigurations(); assertNotNull(configurations); assertTrue(configurations.isEmpty()); }
@Test public void testGetConfigurations() { IWikiTableConfiguration mockConfigA = mockHelper.createMock(IWikiTableConfiguration.class); expect(mockConfigA.getName()).andStubReturn("A"); expect(mockConfigA.isReadOnly()).andStubReturn(true); expect(mockConfigA.clone()).andStubReturn(mockConfigA); IWikiTableConfiguration mockConfigB = mockHelper.createMock(IWikiTableConfiguration.class); expect(mockConfigB.getName()).andStubReturn("B"); expect(mockConfigB.isReadOnly()).andStubReturn(true); expect(mockConfigB.clone()).andStubReturn(mockConfigB); mockHelper.replayAll(); classUnderTest.addBuilInConfiguration(mockConfigA); classUnderTest.addBuilInConfiguration(mockConfigB); List<IWikiTableConfiguration> configurations = classUnderTest.getConfigurations(); assertNotNull(configurations); assertEquals(2, configurations.size()); assertEquals("A", configurations.get(0).getName()); assertEquals("B", configurations.get(1).getName()); }