docs: public Optional<OffsetRange<OffsetType>> clipToBounds(OffsetRange<OffsetType> bounds) {
      if (bounds.contains(this)) {
        return Optional.of(this);
      }
      if (!bounds.overlaps(this)) {
        return Optional.absent();
      }
      final OffsetType newLowerBound;
      final OffsetType newUpperBound;
      if (bounds.startInclusive().asInt() > startInclusive().asInt()) {
        newLowerBound = bounds.startInclusive();
      } else {
        newLowerBound = startInclusive();
      }
      if (bounds.endInclusive().asInt() < endInclusive().asInt()) {
        newUpperBound = bounds.endInclusive();
      } else {
        newUpperBound = endInclusive();
      }
      return Optional.of(OffsetRange.fromInclusiveEndpoints(newLowerBound, newUpperBound));
    }