code: void updateSegmentIndexOffsetIfMissing(long segmentId, Supplier<Long> indexOffsetGetter) {
          SegmentKeyCache cache = null;
          int generation;
          synchronized (this.segmentCaches) {
              generation = this.currentCacheGeneration;
              if (!this.segmentCaches.containsKey(segmentId)) {
                  cache = new SegmentKeyCache(segmentId, this.cache);
              }
          }
  
          if (cache != null) {
              cache.setLastIndexedOffset(indexOffsetGetter.get(), generation);
          }
      }
docs: Updates the Last Indexed Offset for a given Segment, but only if there currently isn't any information about that.
  See {@link #updateSegmentIndexOffset(long, long)} for more details.
  
  @param segmentId         The Id of the Segment to update the Last Indexed Offset for.
  @param indexOffsetGetter A Supplier that is only invoked if there is no information about the current segment. This
  Supplier should return the current value of the Segment's Last Indexed Offset.