InstanceStoreFactoryV1 implements InstanceStoreFactory { @Override public Store<Instance> createNewInstanceStore(String name, InstanceDomain instanceDomain) { return new InstanceStoreV1(instanceStores, name, instanceDomain); } InstanceStoreFactoryV1(IdentifierSourceSet instanceStores); @Override Store<Instance> createNewInstanceStore(String name, InstanceDomain instanceDomain);  }
@Test public void createNewInstanceStoreShouldReturnACorrectlyConstructedInstanceStore() { IdentifierSourceSet identifierSourceSet = mock(IdentifierSourceSet.class); InstanceDomain instanceDomain = mock(InstanceDomain.class); InstanceStoreFactory instanceStoreFactory = new InstanceStoreFactoryV1(identifierSourceSet); Store<Instance> actual = instanceStoreFactory.createNewInstanceStore(STORE_NAME, instanceDomain); Store<Instance> expected = new InstanceStoreV1(identifierSourceSet, STORE_NAME, instanceDomain); assertReflectionEquals(expected, actual); }