Custom LinkedList class implementation in Java.