Add [SequencedCollection
](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/SequencedCollection.html) methods to ImmutableSortedSet
.
#6796
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add
SequencedCollection
methods toImmutableSortedSet
.There are a couple reasons that this is maybe kind of nice, and then there's my real motivation for doing it.
Reasons that this is maybe kind of nice:
@DoNotCall
and@Deprecated
to the mutator methods, as usual.reversed()
toImmutableSortedSet
.But again, those aren't my real motivation. (If they were my real motivation, you might notice, then there would be no reason for us to override
getFirst()
andgetLast()
.)My real motivation is that we are looking to give
guava-android
APIs that use Java 8+ types in their signatures, such asImmutableSet.toImmutableSet
. And as a result of some part of those changes, we start seeing errors in some of our Google-internal build rules. Those errors come because some the desugaring process is inserting its own versions ofgetFirst
and friends, versions that refer to the desugar-provided copies ofSortedSet
andNavigableSet
, which our build process then looks for but cannot find.Since this CL is preparation for adding
ImmutableSet.toImmutableSet
, it constitutes further progress toward #6567RELNOTES=
collect
: AddedSequencedCollection
methods toImmutableSortedSet
.