DERPath { @Override public boolean equals(final Object o) { if (o == this) { return true; } if (o instanceof DERPath) { final DERPath v = (DERPath) o; return LdapUtils.areEqual(nodeStack.toArray(), v.nodeStack.toArray()); } return false; } DERPath();  DERPath(final DERPath path);  DERPath(final String pathSpec); DERPath pushNode(final String name); DERPath pushNode(final String name, final int index); String peekNode(); String popNode(); int getSize(); boolean isEmpty(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); static final String PATH_SEPARATOR; }
@Test(groups = "asn1") public void testEquals() throws Exception { Assert.assertTrue(new DERPath("/SEQ[0]/OCTSTR[1]").equals(new DERPath("/SEQ[0]/OCTSTR[1]"))); Assert.assertFalse(new DERPath("/SEQ[0]/OCTSTR[1]").equals(new DERPath("/SEQ[0]/OCTSTR[2]"))); Assert.assertFalse(new DERPath("/SEQ[0]/OCTSTR[1]").equals(new DERPath("/SEQ/OCTSTR[2]"))); }
@Test(groups = "asn1", dataProvider = "paths") public void testEquals(final String testPath, final String expected) throws Exception { Assert.assertTrue(new DERPath(testPath).equals(new DERPath(expected))); }