You need declare the generic type E as a part of the class declaration or Method declaration:
public abstract class Record
<E> implements Comparable<E> {
Modify the compareTo method of Record as follows:
Further
you should override the toString() method in your Item and Invoice classes to return a meaningful representation of your object.
e.g. in your Item class
Hope this helps