*/
@Test
public void testCanonicalKeyWithDuplicates()
{
ImmutableNode.Builder parentBuilder = new ImmutableNode.Builder(3);
ImmutableNode c1 = new ImmutableNode.Builder().name("child").create();
ImmutableNode c2 = new ImmutableNode.Builder().name("child").create();
ImmutableNode c3 =
new ImmutableNode.Builder().name("child_other").create();
parentBuilder.addChildren(Arrays.asList(c1, c2, c3));
ImmutableNode parent = parentBuilder.create();
NodeHandler<ImmutableNode> testHandler =
new InMemoryNodeModel(parent).getNodeHandler();
XPathExpressionEngine engine = new XPathExpressionEngine();
assertEquals("Wrong key 1", "parent/child[1]",
engine.canonicalKey(c1, "parent", testHandler));