Sample implementation of Linked List in java