### Question:
DefaultGroupService implements GroupService { @Override public Group getGroupByID(String id) { return groupRepository.get(id); } @Autowired  DefaultGroupService(GroupRepository groupRepository); @Override Group getGroupByID(String id); @Override List<Group> getAllGroups(); @Override Group getGroupByTitle(String title); @Override Group save(Group group);  }### Answer:
@Test public void getGroupById() { Group group = createGroup("test"); expect(repository.get("1")).andReturn(group); replay(repository); Group sGroup = service.getGroupByID("1"); assertEquals(sGroup, group); verify(repository); }
@Test public void getGroupById_NotFound() { final String entityId = "456"; expect(repository.get(entityId)).andReturn(null); replay(repository); Group sGroup = service.getGroupByID(entityId); assertNull(sGroup); verify(repository); }