You do not set next
when you create your Nodes, so next
is always null.
This
Node(final Object element, Node prevNode) {
this.element = element;
prevNode = this;
}
should be
Node(final Object element, Node prevNode) {
this.element = element;
prevNode.next = this;
}
solved Erorr with the nullpointer