### Question:
EnvironmentImpl implements Environment { @Override public String toString() { return name + ": " + groups; }  @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 testToString() { when(group1.toString()).thenReturn("g1"); when(group2.toString()).thenReturn("g2"); assertEquals("dev: [g1, g2]", env.toString()); }