<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Collections on Devops Monk</title><link>https://devops-monk.com/tags/collections/</link><description>Recent content in Collections on Devops Monk</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Mon, 04 May 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://devops-monk.com/tags/collections/index.xml" rel="self" type="application/rss+xml"/><item><title>Sequenced Collections (JEP 431): A Unified API for Ordered Collections</title><link>https://devops-monk.com/tutorials/java21/sequenced-collections/</link><pubDate>Mon, 04 May 2026 00:00:00 +0000</pubDate><guid>https://devops-monk.com/tutorials/java21/sequenced-collections/</guid><description>The 30-Year Gap in the Collections API Java&amp;rsquo;s Collections Framework has a fundamental inconsistency: there is no uniform way to access the first or last element of an ordered collection. Before Java 21:
// List — index-based var list = List.of(&amp;#34;a&amp;#34;, &amp;#34;b&amp;#34;, &amp;#34;c&amp;#34;); String first = list.get(0); // first element String last = list.get(list.size() - 1); // last element — verbose, error-prone // Deque — special methods Deque&amp;lt;String&amp;gt; deque = new ArrayDeque&amp;lt;&amp;gt;(List.</description></item></channel></rss>