### Question:
WikiTableConfigurationFactory implements IWikiTableConfigurationFactory { public static List<IWikiTableConfiguration> merge(List<IWikiTableConfiguration> primary, List<IWikiTableConfiguration> secondary){ List<IWikiTableConfiguration> result = new ArrayList<IWikiTableConfiguration>(primary); List<IWikiTableConfiguration> candidates = new ArrayList<IWikiTableConfiguration>(secondary); for (IWikiTableConfiguration aPrimary : primary) { Iterator<IWikiTableConfiguration> it = candidates.iterator(); while (it.hasNext()) { IWikiTableConfiguration aSecondary = it.next(); if(StringUtils.equalsIgnoreCase(aPrimary.getName(), aSecondary.getName())){ it.remove(); } } } result.addAll(candidates); 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 testMerge() throws Exception { IWikiTableConfiguration mockConfigA = mockHelper.createMock(IWikiTableConfiguration.class); expect(mockConfigA.getName()).andStubReturn("A"); IWikiTableConfiguration mockConfigBSecondary = mockHelper.createMock(IWikiTableConfiguration.class); expect(mockConfigBSecondary.getName()).andStubReturn("B"); IWikiTableConfiguration mockconfigASecondary = mockHelper.createMock(IWikiTableConfiguration.class); expect(mockconfigASecondary.getName()).andStubReturn("A"); mockHelper.replayAll(); List<IWikiTableConfiguration> primary = new ArrayList<IWikiTableConfiguration>(); primary.add(mockConfigA); List<IWikiTableConfiguration> secondary = new ArrayList<IWikiTableConfiguration>(); secondary.add(mockconfigASecondary); secondary.add(mockConfigBSecondary); List<IWikiTableConfiguration> merged = WikiTableConfigurationFactory.merge(primary, secondary); assertEquals(1, primary.size()); assertEquals(2, secondary.size()); assertEquals(2, merged.size()); }