### Question:
QueueStatistics extends SerializableBase { public void updateJobExecutionTime(String date, JobRunTime jobRunTimeDelta) { JobRunTime val = this.jobRunTime.getOrDefault(date, null); if (val == null) { this.jobRunTime.put(date, jobRunTimeDelta); } else { val.setMax(Math.max(val.getMax(), jobRunTimeDelta.getMax())); val.setMin(Math.min(val.getMin(), jobRunTimeDelta.getMin())); val.setJobCount(val.getJobCount() + jobRunTimeDelta.getJobCount()); val.setTotalExecutionTime( val.getTotalExecutionTime() + jobRunTimeDelta.getTotalExecutionTime()); this.jobRunTime.put(date, val); } } QueueStatistics(String id); void updateTime(); void incrementDeadLetter(String date, long delta); void update(TasksStat stat, String eventDate); void incrementDiscard(String date, long delta); void incrementSuccessful(String date, long delta); void updateJobExecutionTime(String date, JobRunTime jobRunTimeDelta); void pruneStats(LocalDate date, int maxDays); void incrementRetry(String date, long delta); long tasksDiscarded(String date); long tasksSuccessful(String date); long tasksMovedToDeadLetter(String date); long tasksRetried(String date); JobRunTime jobRunTime(String date);  }### Answer:
@Test public void updateJobExecutionTime() { JobRunTime jobRunTime = new JobRunTime(100L, 300L, 1100, 10); JobRunTime jobRunTime2 = new JobRunTime(50L, 250L, 100, 100); JobRunTime jobRunTime3 = new JobRunTime(100L, 400L, 1000, 4); QueueStatistics queueStatistics = new QueueStatistics(id); assertNotNull(queueStatistics.getJobRunTime()); queueStatistics.updateJobExecutionTime("2020-03-11", jobRunTime); assertEquals(jobRunTime, queueStatistics.getJobRunTime().get("2020-03-11")); queueStatistics.updateJobExecutionTime("2020-03-12", jobRunTime); assertEquals(2, queueStatistics.getJobRunTime().size()); assertEquals(jobRunTime, queueStatistics.getJobRunTime().get("2020-03-12")); queueStatistics.updateJobExecutionTime("2020-03-12", jobRunTime); assertEquals(2, queueStatistics.getJobRunTime().size()); assertEquals( new JobRunTime(100, 300, 2200, 20), queueStatistics.getJobRunTime().get("2020-03-12")); queueStatistics.updateJobExecutionTime("2020-03-12", jobRunTime2); assertEquals(2, queueStatistics.getJobRunTime().size()); assertEquals( new JobRunTime(50, 300, 2300, 120), queueStatistics.getJobRunTime().get("2020-03-12")); queueStatistics.updateJobExecutionTime("2020-03-12", jobRunTime3); assertEquals( new JobRunTime(50, 400, 3300, 124), queueStatistics.getJobRunTime().get("2020-03-12")); }