Can anyone show me how I can swap two items in a two-way linked list, by
changing just the references not the data?

I've got an idea but I don't know if this is correct (first points at the
first of the two items to be swapped).

swap(ListIterator first) {
ListNode temp = first;

(first.previous).next = first.next;

first = first.next;
first.previous = temp.previous;

first.next = temp;

(first.next).previous = first;
}

first, next, previous are all ListNode objects.