Linked list test class in java