code: public Optional<Range<T>> intersection(final Range<T> other) {
          if (!this.isOverlappedBy(other)) {
              return Optional.empty();
          } else if (this.equals(other)) {
              return Optional.of(this);
          }
  
          final LowerEndpoint<T> newLowerEndpoint = lowerEndpoint.includes(other.lowerEndpoint.value) ? other.lowerEndpoint : lowerEndpoint;
          final UpperEndpoint<T> newUpperEndpoint = upperEndpoint.includes(other.upperEndpoint.value) ? other.upperEndpoint : upperEndpoint;
  
          BoundType boundType = null;
  
          if (newLowerEndpoint.isClosed) {
              boundType = newUpperEndpoint.isClosed ? BoundType.CLOSED_CLOSED : BoundType.CLOSED_OPEN;
          } else {
              boundType = newUpperEndpoint.isClosed ? BoundType.OPEN_CLOSED : BoundType.OPEN_OPEN;
          }
  
          return Optional.of(new Range<T>(newLowerEndpoint, newUpperEndpoint, boundType));
      }
docs: Calculate the intersection of {@code this} and an overlapping Range.
  
  @param other
  overlapping Range
  @return range representing the intersection of {@code this} and {@code other}, {@code this} if equal, or <code>Optional.empty()</code> if they're not overlapped.
  @since 3.0.1