code: public static <OffsetType extends Offset<OffsetType>> Ordering<ScoringTypedOffsetRange<OffsetType>>
      orderByOverlapWith(final ScoringTypedOffsetRange<OffsetType> reference) {
      return new Ordering<ScoringTypedOffsetRange<OffsetType>>() {
        @Override
        public int compare(final ScoringTypedOffsetRange<OffsetType> left, final
        ScoringTypedOffsetRange<OffsetType> right) {
          final int leftIntersectionSize =
              left.offsetRange().intersection(reference.offsetRange())
                  .transform(OffsetRange.lengthFunction()).or(0);
          final int rightIntersectionSize = right.offsetRange().intersection(reference.offsetRange())
              .transform(OffsetRange.lengthFunction()).or(0);
  
          return Ints.compare(leftIntersectionSize, rightIntersectionSize);
        }
      };
    }
docs: Provides an ordering of {@code ScoringTypedOffsetRange} by their degree of overlap with a
  reference {@code ScoringTypedOffsetRange}, from least overlap to most.