Linked list impl in java