Java implementation of a Linked List with inheritance and exceptions