/** * Inserts the given element at the end of this list. */ public void addLast(T element) { if(size==0) { last = new ListElement(element); } else { ListElement tmp = last; last = new ListElement(element); tmp.next = last; } size++; }