### Question:
ToolGroupEventService implements EntityEventService { @Override public void updateEventsWithChildrenAndIssues(final Long id) { eventManager.addUpdateEvent(EventObjectType.TOOL_GROUP.name().toLowerCase(), id); eventManager.addUpdateEventsForIssues(id, AclClass.TOOL_GROUP); ListUtils.emptyIfNull(toolManager.loadToolsByGroup(id)) .forEach(tool -> toolEventService.updateEventsWithChildrenAndIssues(tool.getId())); }  @Override AclClass getSupportedClass(); @Override void updateEventsWithChildrenAndIssues(final Long id);  }### Answer:
@Test @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) public void shouldAddToolGroupEvent() { doNothing().when(entityManager).setManagers(anyListOf(SecuredEntityManager.class)); Tool tool1 = new Tool(); tool1.setId(1L); Tool tool2 = new Tool(); tool2.setId(2L); when(issueManager.loadIssuesForEntity(any())) .thenReturn(Arrays.asList(Issue.builder().id(1L).build(), Issue.builder().id(2L).build())); when(toolManager.loadToolsByGroup(anyLong())).thenReturn(Arrays.asList(tool1, tool2)); doNothing().when(eventDao).insertUpdateEvent(anyString(), anyLong()); toolGroupEventService.updateEventsWithChildrenAndIssues(1L); verify(eventDao).insertUpdateEvent("tool_group", 1L); verify(eventDao).insertUpdateEvent("tool", 1L); verify(eventDao).insertUpdateEvent("tool", 2L); verify(eventDao, times(3)).insertUpdateEvent("issue", 1L); verify(eventDao, times(3)).insertUpdateEvent("issue", 2L); verifyNoMoreInteractions(eventDao); }