On Sun, 28 Aug 2022 05:45:54 GMT, Grzegorz Piwowarek <d...@openjdk.org> wrote:
>> PR for Sequenced Collections implementation. > > src/java.base/share/classes/java/util/SequencedCollection.java line 84: > >> 82: * the iterator() method, calls next() on it and returns the result. >> 83: */ >> 84: default E getFirst() { > > Too bad there's no `Optional<E>` here, but I assume that's because you don't > want to mix two approaches within a class hierarchy? I wanted to make `getFirst` et. al. be identical to the methods already in `Deque`, to avoid proliferation of methods. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/7387#discussion_r957518311