public E pop() {
        if (size() == 0)
            return null;

        Node<E> temp = last;
        last = last.getPrevious();
        if (last != null)
            last.setNext(null);
        size--;
        return temp.getElement();
    }