@Override
		public RedBlackEntry<K, V> next() {
			if (modCount != expectedModCount) {
				throw new ConcurrentModificationException();
			}
			if (nextNode == null) {
				return null;
			}
			lastReturnedNode = nextNode;
			previousNode = nextNode;
			nextNode = forward ? nextNode.getSuccessor() : nextNode.getPredecessor();
			return lastReturnedNode;
		}
Swap the linkages of two nodes in a tree.
Ghidra/Framework/Generic/src/main/java/ghidra/util/datastruct/RedBlackTree.java