### Question:
DockerUtil { public long getContainerStartedAt(String id) { LoggingService.logDebug(MODULE_NAME ,"Get Container Started At"); InspectContainerResponse inspectInfo = dockerClient.inspectContainerCmd(id).exec(); String startedAt = inspectInfo.getState().getStartedAt(); LoggingService.logDebug(MODULE_NAME ,"Finished get Container Started At"); return startedAt != null ? DateTimeFormatter.ISO_INSTANT.parse(startedAt, Instant::from).toEpochMilli() : Instant.now().toEpochMilli(); } private  DockerUtil(); static DockerUtil getInstance(); void reInitDockerClient(); String getDockerBridgeName(); void startContainer(Microservice microservice); void stopContainer(String id); void removeContainer(String id, Boolean withRemoveVolumes); @SuppressWarnings("deprecation") String getContainerIpAddress(String id); String getContainerName(Container container); String getContainerMicroserviceUuid(Container container); static String getIoFogContainerName(String microserviceUuid); Optional<Container> getContainer(String microserviceUuid); MicroserviceStatus getMicroserviceStatus(String containerId); List<Container> getRunningContainers(); List<Container> getRunningIofogContainers(); Optional<Statistics> getContainerStats(String containerId); long getContainerStartedAt(String id); boolean areMicroserviceAndContainerEqual(String containerId, Microservice microservice); Optional<String> getContainerStatus(String containerId); boolean isContainerRunning(String containerId); List<Container> getContainers(); void removeImageById(String imageId); @SuppressWarnings("resource") void pullImage(String imageName, String microserviceUuid, Registry registry); boolean findLocalImage(String imageName); String createContainer(Microservice microservice, String host); PruneResponse dockerPrune(); void update(PullResponseItem item, Map<String, ItemStatus> statuses);  }### Answer:
@Test public void testGetContainerStartedAt() { assertNotNull(dockerUtil.getContainerStartedAt(containerID)); Mockito.verify(dockerClient).inspectContainerCmd(any()); Mockito.verify(inspectContainerResponse).getState(); Mockito.verify(containerState).getStartedAt(); }
@Test public void testGetContainerStartedAtWhenReturnStartTime() { Instant startAt = Instant.now(); PowerMockito.when(containerState.getStartedAt()).thenReturn(String.valueOf(startAt)); assertEquals(startAt.toEpochMilli(), dockerUtil.getContainerStartedAt(containerID)); Mockito.verify(dockerClient).inspectContainerCmd(any()); Mockito.verify(inspectContainerResponse).getState(); Mockito.verify(containerState).getStartedAt(); }