DockerInstance implements CloudInstance, DockerCloudErrorHandler { @Nonnull @Override public Date getStartedTime() { return Date.from(startedTime); } DockerInstance(@Nonnull DockerImage img); @Nonnull @Override String getInstanceId(); @Nonnull Optional<String> getTaskId(); @Nonnull @Override String getName(); @Nonnull Optional<String> getAgentHolderName(); @Nonnull Optional<String> getResolvedImageName(); void bindWithAgentHolder(@Nonnull NewAgentHolderInfo agentHolderInfo); @Nonnull @Override String getImageId(); @Nonnull @Override DockerImage getImage(); @Nonnull @Override Date getStartedTime(); @Nullable @Override String getNetworkIdentity(); @Nonnull @Override InstanceStatus getStatus(); @Nullable @Override CloudErrorInfo getErrorInfo(); @Nonnull Optional<AgentHolderInfo> getAgentHolderInfo(); boolean registerOrCompareAgentId(int agentId); @Nonnull Optional<UUID> getAgentRuntimeUuid(); void registerAgentRuntimeUuid(@Nonnull UUID agentRuntimeUuid); void unregisterAgentRuntimeUUid(@Nonnull UUID agentRuntimeUuid); @Override void notifyFailure(@Nonnull String msg, @Nullable Throwable throwable); @Override boolean containsAgent(@Nonnull AgentDescription agent); @Override String toString();  }
@Test public void startedTimeInitializedAfterConstruct() { DockerInstance instance = createInstance(); assertThat(instance.getStartedTime()).isInSameMinuteAs(new Date()); }