LinkedList insert After node
<p>I've been trying to insert a node into a linked list after the current node using Java. I've been able to get the insertion before the current node but I cannot get this to work:</p>

<p>Here is the code for <code>insertNodeBefore</code>. I just want to know if there is a way to adapt this to be able to insert after the current node?</p>

<pre><code>// Insert new node nVal to the list before current node curVal 
public void insertNodeBefore(E nVal, E curVal) {
    Node&lt;E&gt; newNode = new Node&lt;E&gt;(nVal);

    Node&lt;E&gt; curr = head;
    Node&lt;E&gt; prev = null;

    if (head.getNodeValue() == curVal) {
        newNode.setNext(head);
        head = newNode;
        return;
    }

    // scan until locate node or come to end of list
    while (curr != null) {
        // have a match 
        if (curr.getNodeValue() == curVal) {
            // insert node
            newNode.setNext(curr);
            prev.setNext(newNode);
            break;
        } else {
            // advanced curr and prev
            prev = curr;
            curr = curr.getNext();
        }
    }
}
</code></pre>