### Question:
GroupList { public Group getEqual(@Nullable Group group) { if (group == null) { return null; } for (Group next : groups) { if (next.getUuid().equals(group.getUuid())) { return next; } } return null; }  GroupList setGroups(List<Group> groups); List<Group> getGroups(); Group getEqual(@Nullable Group group);  }### Answer:
@Test public void testGetEqual_withoutElements() throws Exception { assertNull(sut.getEqual(new Group())); }
@Test public void testGetEqual() throws Exception { Group toGetAfterwards = new Group(); sut.setGroups(Arrays.asList(new Group(), toGetAfterwards)); Group toSearch = new Group(); toSearch.setUuid(toGetAfterwards.getUuid()); assertSame(sut.getEqual(toSearch), toGetAfterwards); }