doubly circular linked list
===

Help!

I am attempting to write a method that will add a node to a doubly circular linked list in java. I am having a very difficult time getting a code to run the way I need to get it to run. 
I am constantly getting null point exception and when that does not happen I get an infinite loop with the first node. Anyone who has any advice how to add a node to a doubly circular linked list it would be greatly appreciated. 