code: private CompletableFuture<Void> excludeObsolete(DirectSegmentAccess segment, CompactionArgs args,
                                                      Map<UUID, TableBucket> buckets, TimeoutTimer timer) {
          // Exclude all those Table Entries whose buckets altogether do not exist.
          args.candidates.keySet().removeIf(hash -> {
              val bucket = buckets.get(hash);
              return bucket == null || !bucket.exists();
          });
  
          // For every Bucket that still exists, find all its Keys and match with our candidates and figure out if our
          // candidates are still eligible for compaction.
          val br = TableBucketReader.key(segment, this.indexReader::getBackpointerOffset, this.executor);
          val candidates = args.candidates.entrySet().iterator();
          return Futures.loop(
                  candidates::hasNext,
                  () -> {
                      val e = candidates.next();
                      long bucketOffset = buckets.get(e.getKey()).getSegmentOffset();
                      BiConsumer<TableKey, Long> handler = (key, offset) -> e.getValue().handleExistingKey(key, offset);
                      return br.findAll(bucketOffset, handler, timer);
                  },
                  this.executor);
      }
docs: Processes the given {@link CompactionArgs} and eliminates all {@link Candidate}s that meet at least one of the
  following criteria:
  - The Key's Table Bucket is no longer part of the index (removal)
  - The Key exists in the Index, but the Index points to a newer version of it.
  
  @param segment A {@link DirectSegmentAccess} representing the Segment to operate on.
  @param args    A {@link CompactionArgs} representing the set of {@link Candidate}s for compaction. This set
  will be modified based on the outcome of this method.
  @param buckets The Buckets retrieved via the {@link IndexReader} for the {@link Candidate}s.
  @param timer   Timer for the operation.
  @return A CompletableFuture that, when completed, will indicate the operation has finished.