InstanceStoreFactoryV2 implements InstanceStoreFactory { @Override public Store<Instance> createNewInstanceStore(String name, InstanceDomain instanceDomain) { return new InstanceStoreV2(identifierSourceSet, name, instanceDomain, stringStore); } InstanceStoreFactoryV2(IdentifierSourceSet identifierSourceSet, PcpStringStore stringStore); @Override Store<Instance> createNewInstanceStore(String name, InstanceDomain instanceDomain);  }
@Test public void shouldCreateANewInstanceStoreV2() { IdentifierSourceSet identifierSourceSet = mock(IdentifierSourceSet.class); PcpStringStore stringStore = mock(PcpStringStore.class); InstanceDomain instanceDomain = mock(InstanceDomain.class); InstanceStoreFactory instanceStoreFactory = new InstanceStoreFactoryV2(identifierSourceSet, stringStore); Store<Instance> actual = instanceStoreFactory.createNewInstanceStore(STORE_NAME, instanceDomain); Store<Instance> expected = new InstanceV2.InstanceStoreV2(identifierSourceSet, STORE_NAME, instanceDomain, stringStore); assertReflectionEquals(expected, actual); }