// Textbook fragment 05.18 public E removeLast() throws EmptyDequeException { if (isEmpty()) throw new EmptyDequeException("Deque is empty."); DLNode last = trailer.getPrev(); E o = last.getElement(); DLNode secondtolast = last.getPrev(); trailer.setPrev(secondtolast); secondtolast.setNext(trailer); size--; return o; }