title: Java Collection for special scrolling, circular queue
body: <p>I'm looking for something similar to <a href="http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/ConcurrentLinkedQueue.html" rel="nofollow noreferrer"><code>ConcurrentLinkedQueue</code></a>, but with the following behaviors:</p>
  <ul>
  <li>When I <code>peek()</code>/<code>poll()</code> the queue, it retrieves the HEAD, does <strong>not</strong> remove it, and then subsequently advances the HEAD one node towards the TAIL</li>
  <li>When the HEAD == TAIL, the next time I <code>peek()</code>/<code>poll()</code>, the HEAD is reset to its original node (thus &quot;circular&quot; behaviour)</li>
  </ul>
  <p>So if I created the queue like so:</p>
  <pre><code>MysteryQueue&lt;String&gt; queue = new MysteryQueue&lt;String&gt;();
  queue.add(&quot;A&quot;); // The &quot;original&quot; HEAD
  queue.add(&quot;B&quot;);
  queue.add(&quot;C&quot;);
  queue.add(&quot;D&quot;); // TAIL
  
  String str1 = queue.peek(); // Should be &quot;A&quot;
  String str2 = queue.peek(); // Should be &quot;B&quot;
  String str3 = queue.peek(); // Should be &quot;C&quot;
  String str4 = queue.peek(); // Should be &quot;D&quot;
  String str5 = queue.peek(); // Should be &quot;A&quot; again
  </code></pre>
  <p>In this fashion, I can peek/poll all day long, and the queue will just keep scrolling through my queue, over and over again.</p>
  <p>Does the JRE ship with anything like this? If not, perhaps something in Apache Commons Collections, or some other third party lib?</p>