### Question:
FailedCheckpointStats extends AbstractCheckpointStats { @Override public long getEndToEndDuration() { return Math.max(0, failureTimestamp - triggerTimestamp); } FailedCheckpointStats(
			long checkpointId,
			long triggerTimestamp,
			CheckpointProperties props,
			int totalSubtaskCount,
			Map<JobVertexID, TaskStateStats> taskStats,
			int numAcknowledgedSubtasks,
			long stateSize,
			long alignmentBuffered,
			long failureTimestamp,
			@Nullable SubtaskStateStats latestAcknowledgedSubtask,
			@Nullable Throwable cause); @Override CheckpointStatsStatus getStatus(); @Override int getNumberOfAcknowledgedSubtasks(); @Override long getStateSize(); @Override long getAlignmentBuffered(); @Override @Nullable SubtaskStateStats getLatestAcknowledgedSubtaskStats(); @Override long getEndToEndDuration(); long getFailureTimestamp(); @Nullable String getFailureMessage();  }### Answer:
@Test public void testEndToEndDuration() throws Exception { long duration = 123912931293L; long triggerTimestamp = 10123; long failureTimestamp = triggerTimestamp + duration; Map<JobVertexID, TaskStateStats> taskStats = new HashMap<>(); JobVertexID jobVertexId = new JobVertexID(); taskStats.put(jobVertexId, new TaskStateStats(jobVertexId, 1)); FailedCheckpointStats failed = new FailedCheckpointStats( 0, triggerTimestamp, CheckpointProperties.forCheckpoint(CheckpointRetentionPolicy.NEVER_RETAIN_AFTER_TERMINATION), 1, taskStats, 0, 0, 0, failureTimestamp, null, null); assertEquals(duration, failed.getEndToEndDuration()); }