<div dir="ltr"><div>Here is the table "Comparison of Stack and Deque methods" that lists equivalent Deque methods compared to Stack methods: <a href="https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/util/Deque.html">https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/util/Deque.html</a></div><div><br></div><div>At the moment, getFirst() is said to be equivalent to peek(). Since peek() doesn't throw an exception when the queue/stack is empty, peekFirst() could be a better equivalent because getFirst() throws.</div><div><br></div><div>In fact, the documentation of the peek() method itself says that this method is equivalent to peekFirst(): <a href="https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/util/Deque.html#peek()">https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/util/Deque.html#peek()</a>.</div><div><br></div><div>If this should be posted somewhere else, please let me know. I am still new to using mailing lists. Cheers.<br></div><div><br></div><div><br></div></div>