### Question:
APIServiceStatusService { public List<ContainerStatusChangeEvent> getRecentlyUpdatedContainersAsEvents() { List<ContainerStatusChangeEvent> recentEvents = new ArrayList<>(); Iterable<APIContainer> allContainers = cachedProductFamilyService.getRecentlyUpdatedContainers(); allContainers.forEach(container -> { cachedProductFamilyService.calculateContainerServiceTotals(container); addContainerEvent(recentEvents, container); }); if (!recentEvents.isEmpty()) { log.debug("Recent events found: " + recentEvents.size()); } return recentEvents; } @Autowired  APIServiceStatusService(CachedProductFamilyService cachedProductFamilyService,
                                   CachedServicesService cachedServicesService,
                                   CachedApiDocService cachedApiDocService); ResponseEntity<Applications> getCachedApplicationStateResponse(); Applications getCachedApplicationState(); List<ContainerStatusChangeEvent> getContainersStateAsEvents(); ResponseEntity<String> getServiceCachedApiDocInfo(@NonNull String serviceId, String apiVersion); List<ContainerStatusChangeEvent> getRecentlyUpdatedContainersAsEvents();  }### Answer:
@Test public void testGetRecentlyChangedEvents() { List<APIContainer> containers = createContainers(); when(cachedProductFamilyService.getRecentlyUpdatedContainers()).thenReturn(containers); doNothing().when(this.cachedProductFamilyService).calculateContainerServiceTotals(any(APIContainer.class)); List<ContainerStatusChangeEvent> events = apiServiceStatusService.getRecentlyUpdatedContainersAsEvents(); assertNotNull(events); assertEquals(2, events.size()); assertEquals("API One", events.get(0).getTitle()); assertEquals("API Two", events.get(1).getTitle()); }