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 testCheckLimitForBlobWithNegativeSize() {
        assertThatThrownBy(() -> tracker.checkLimit(-1L))
                .isInstanceOf(IllegalArgumentException.class);
    }