XPathUtil { public static boolean equals(Name targetNodeName, StepList targetXPath) { if (targetXPath.size() == 1) { Step rootStep = targetXPath.get(0); QName stepName = rootStep.getName(); if (Types.equals(targetNodeName, stepName)) { return true; } } return false; }  static StepList rootElementSteps(final AttributeDescriptor rootElement,
            final NamespaceSupport namespaces); static StepList steps(final AttributeDescriptor root, final String xpathExpression,
            final NamespaceSupport namespaces); static boolean equals(Name targetNodeName, StepList targetXPath);  }
@Test public void testStepEquals() { XPathUtil.Step step1 = new XPathUtil.Step(XLINK.FROM, 1); XPathUtil.Step step2 = new XPathUtil.Step(XLINK.HREF, 1, false); XPathUtil.Step step3 = new XPathUtil.Step(XLINK.HREF, 1, false); XPathUtil.Step step4 = new XPathUtil.Step(XLINK.HREF, 1, true); XPathUtil.Step step5 = new XPathUtil.Step(XLINK.HREF, 2, false); assertFalse(step1.equals(null)); assertFalse(step1.equals(new Object())); assertFalse(step1.equals(step2)); assertTrue(step2.equals(step3)); assertFalse(step2.equals(step4)); assertFalse(step2.equals(step5)); }