### Question:
EnvironmentImpl implements Environment { @Override public ComponentGroup getGroupWithName(String groupName) { return findGroup(group -> group.getName().equals(groupName), () -> "groupName=" + groupName); }  @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 findGroupByName() { assertEquals(group2, env.getGroupWithName("group2")); assertThrows(IllegalArgumentException.class, () -> env.getGroupWithName("group3")); }