/**
* Test getElementIndex behavior if some elements are zero-length,
* i.e. start and end offsets are the same.
*/
public void testGetElementIndex02() {
BranchElement root = doc.new BranchElement(null, null);
LeafElement[] leaves = { doc.new LeafElement(root, null, 0, 0), // [0]
doc.new LeafElement(root, null, 0, 1), // [1]
doc.new LeafElement(root, null, 0, 1), // [2]
doc.new LeafElement(root, null, 1, 1), // [3]
doc.new LeafElement(root, null, 1, 1), // [4]
doc.new LeafElement(root, null, 1, 2), // [5]
doc.new LeafElement(root, null, 2, 3) // [6]
};
root.replace(0, 0, leaves);
assertEquals(0, root.getElementIndex(-1));
assertEquals(1, root.getElementIndex(0));
assertEquals(5 /*2*/, root.getElementIndex(1));
assertEquals(6, root.getElementIndex(2));
assertEquals(6, root.getElementIndex(3));
assertEquals(6, root.getElementIndex(4));
}