code: List<Long> includeUpdateBatch(TableKeyBatch batch, long batchOffset, int generation) {
          val result = new ArrayList<Long>(batch.getItems().size());
          synchronized (this) {
              for (TableKeyBatch.Item item : batch.getItems()) {
                  long itemOffset = batchOffset + item.getOffset();
                  CacheBucketOffset existingOffset = get(item.getHash(), generation);
                  if (existingOffset == null || itemOffset > existingOffset.getSegmentOffset()) {
                      // We have no previous entry, or we do and the current offset is higher, so it prevails.
                      this.tailOffsets.put(item.getHash(), new CacheBucketOffset(itemOffset, batch.isRemoval()));
                      result.add(itemOffset);
                  } else {
                      // Current offset is lower.
                      result.add(existingOffset.getSegmentOffset());
                  }
  
                  if (existingOffset != null) {
                      // Only record a backpointer if we have a previous location to point to.
                      this.backpointers.put(itemOffset, existingOffset.getSegmentOffset());
                  }
              }
          }
  
          return result;
      }
docs: Updates the tail cache for with the contents of the given {@link TableKeyBatch}.
  Each {@link TableKeyBatch.Item} is updated only if no previous entry exists with its {@link TableKeyBatch.Item#getHash()}
  or if its {@link TableKeyBatch.Item#getOffset()} is greater than the existing entry's offset.
  
  This method should be used for processing new updates to the Index (as opposed from bulk-loading already indexed keys).
  
  @param batch       An {@link TableKeyBatch} containing items to accept into the Cache.
  @param batchOffset Offset in the Segment where the first item in the {@link TableKeyBatch} has been written to.
  @param generation  The current Cache Generation (from the Cache Manager).
  @return A List of offsets for each item in the {@link TableKeyBatch} (in the same order) of where the latest value
  for that item's Key exists now.