equalsNodes method
Returns true if node1 and node2 are the same instance.
Implementation
bool equalsNodes(T? node1, T? node2) {
if (node1 == null || node2 == null) return false;
if (identical(node1, node2)) return true;
return node1 == node2;
}