Sequenced Collections in Java 21+: getFirst, getLast and reversed()
JEP 431's SequencedCollection, SequencedSet and SequencedMap give List, Deque, LinkedHashSet, LinkedHashMap and TreeMap a shared getFirst/getLast/reversed() contract. This replaces the stream.reduce((a,b)->b) and skip(size-1) tricks people use to find the last element of a Set, with real javap-verified interface output and a working demo of why reversed() is a live view, not a copy.