### Question:
PythianStateFactory { public Map<String, StateFactory> createStateFactories(ComponentConfiguration componentConfiguration) { Map<String, StateFactory> stateFactoriesByIds = new HashMap<>(); for (PythianStateConfiguration stateConfiguration : componentConfiguration.getStates()) { PythianState pythianState = this.createStateFactory(stateConfiguration); StateFactory stateFactory = pythianState.createStateFactory(); stateFactoriesByIds.put(stateConfiguration.getName(), stateFactory); } return stateFactoriesByIds; }  Map<String, StateFactory> createStateFactories(ComponentConfiguration componentConfiguration);  }### Answer:
@Test public void should_create_state_factory() { final PythianStateDescription description = new PythianStateDescription(TestPythianState.class, "Mocked state"); final PythianStateConfiguration expectedStateConfiguration = new PythianStateConfiguration("test", description, EMPTY_LIST); ComponentConfiguration componentConfiguration = mock(ComponentConfiguration.class); given(componentConfiguration.getStates()).willReturn(asList(expectedStateConfiguration)); Map<String, StateFactory> stateFactories = factory.createStateFactories(componentConfiguration); StateFactory actualStateFactory = stateFactories.get("test"); assertThat(actualStateFactory).isSameAs(EXPECTED_STATE_FACTORY); }