public JobStatsExtended enrich(JobStats jobStats) {
        JobStats latestJobStats = getLatestJobStats(jobStats, previousJobStats);
        if (lock.tryLock()) {
            setFirstRelevantJobStats(latestJobStats);
            setJobStatsExtended(latestJobStats);
            setPreviousJobStats(latestJobStats);
            lock.unlock();
        }
        return jobStatsExtended;
    }
@Test
    void estimatedTimeProcessingIsCalculated2() {
        JobStats jobStats0 = getJobStats(now().minusSeconds(60), 100L, 0L, 0L, 100L);
        JobStats jobStats1 = getJobStats(now().minusSeconds(50), 85L, 5L, 0L, 110L);
        JobStats jobStats2 = getJobStats(now().minusSeconds(40), 75L, 5L, 0L, 120L);
        JobStats jobStats3 = getJobStats(now().minusSeconds(30), 65L, 5L, 0L, 130L);
        JobStats jobStats4 = getJobStats(now().minusSeconds(20), 55L, 5L, 0L, 140L);
        JobStats jobStats5 = getJobStats(now().minusSeconds(10), 45L, 5L, 0L, 150L);
        JobStats jobStats6 = getJobStats(now(), 35L, 5L, 0L, 160L);

        JobStatsExtended jobStatsExtended = enrich(jobStats0, jobStats1, jobStats2, jobStats3, jobStats4, jobStats5, jobStats6);

        assertThat(jobStatsExtended.getEstimation().isProcessingDone()).isFalse();
        assertThat(Duration.between(now(), jobStatsExtended.getEstimation().getEstimatedProcessingFinishedAt()).toSeconds()).isCloseTo(40L, Offset.offset(1L));
    }