SequenceNode seq2 = (SequenceNode) node2;
assertEquals(seq1.getTag(), seq2.getTag());
assertEquals(seq1.getValue().size(), seq2.getValue().size());
Iterator<Node> iter2 = seq2.getValue().iterator();
for (Node child1 : seq1.getValue()) {
Node child2 = iter2.next();
compareNodes(child1, child2);
}
} else {
MappingNode seq1 = (MappingNode) node1;
MappingNode seq2 = (MappingNode) node2;
assertEquals(seq1.getTag(), seq2.getTag());
assertEquals(seq1.getValue().size(), seq2.getValue().size());
Iterator<NodeTuple> iter2 = seq2.getValue().iterator();
for (NodeTuple child1 : seq1.getValue()) {
NodeTuple child2 = iter2.next();
compareNodes(child1.getKeyNode(), child2.getKeyNode());
compareNodes(child1.getValueNode(), child2.getValueNode());
}
}
}
}