### Question:
EnvironmentImpl implements Environment { @Override public Components getAllComponents() { List<Component> components = groups.stream() .map(ComponentGroup::getComponents) .map(Components::asList) .flatMap(List::stream) .collect(toList()); return new ComponentsImpl(components, propertiesFactory); }  @Override List<ComponentGroup> findGroupsWithIp(String ip); @Override ComponentGroup getGroupWithName(String groupName); @Override Optional<ComponentGroup> findGroupWithComponent(String componentName); @Override Components getAllComponents(); @Override Component getComponentWithName(String componentName); @Override Components findComponentsFrom(List<String> groups, List<String> componentNames); @Override Component findComponentWithName(String componentName); @Override String toString();  }### Answer:
@Test void getAllComponents() { assertEquals(new ComponentsImpl(asList(one, two, three), factory2), env.getAllComponents()); }