int count = expectedCopy.getChildCount();
assertEquals(message, count, actualCopy.getChildCount());
int nonTextNodes = count;
for (int i = 0; i < count; i++) {
Node child1 = expectedCopy.getChild(i);
// could remove this instanceof Test by having combineTextNodes
// set a list of text indices
if (child1 instanceof Text) {
nonTextNodes--;
Node child2 = actualCopy.getChild(i);
assertEquals(message, child1, child2);
}
}
// now compare everything that isn't text using the original
// element objects
for (int i = 0; i < nonTextNodes; i++) {
Node expectedChild = getNonTextNode(expected, i);
Node actualChild = getNonTextNode(actual, i);
assertEquals(message, expectedChild, actualChild);
}
}