Java Util Linked List - how to find next?
<p>When using Java <a href="http://download.oracle.com/javase/6/docs/api/java/util/LinkedList.html" rel="nofollow">LinkedList</a> how do you find out the element's next or previous relationships?</p>

<p>I mean, in a regular linked list I would do something like this:</p>

<pre><code>Node node1 = new Node();
Node node2 = new Node();
LinkedList list = new LinkedList();
list.add(node1);
list.add(node2);

//then my node1 will know who it's next is:
assertEquals(node2, node1.next());
</code></pre>

<p>where <strong>Node</strong> is my own container for data/object.</p>

<p>But in Java's LinkedList, the data does not seem to be modified. So how do I actually find out who the "next" (or "previous" in the case of doubly-linked lists) element is?</p>
