public List<Tuple2<JobID, BlobKey>> checkLimit(long size) {
        checkArgument(size >= 0);

        synchronized (lock) {
            List<Tuple2<JobID, BlobKey>> blobsToDelete = new ArrayList<>();

            long current = total;

            for (Map.Entry<Tuple2<JobID, BlobKey>, Long> entry : caches.entrySet()) {
                if (current + size > sizeLimit) {
                    blobsToDelete.add(entry.getKey());
                    current -= entry.getValue();
                }
            }

            return blobsToDelete;
        }
    }
@Test
    void testCheckLimit() {
        List<Tuple2<JobID, BlobKey>> keys = tracker.checkLimit(3L);

        assertThat(keys).hasSize(1);
        assertThat(keys.get(0).f0).isEqualTo(jobId);
        assertThat(keys.get(0).f1).isEqualTo(blobKey);
    }