guava/src/com/google/common/collect/GeneralRange.java
static <T> GeneralRange<T> range(
      Comparator<? super T> comparator,
      @Nullable T lower,
      BoundType lowerType,
      @Nullable T upper,
      BoundType upperType) {
    return new GeneralRange<T>(comparator, true, lower, lowerType, true, upper, upperType);
  }
static <T> GeneralRange<T> range(
      Comparator<? super T> comparator,
      @Nullable T lower,
      BoundType lowerType,
      @Nullable T upper,
      BoundType upperType) {
    return new GeneralRange<T>(comparator, true, lower, lowerType, true, upper, upperType);
  }
Returns everything between the endpoints relative to the specified comparator, with the
specified endpoint behavior.