@Test public void shouldConsiderSegmentCreatedWithParentReferenceToBeEqualToStaticSingleton() { segment = factory.createSegment(Path.PARENT); assertThat(segment.equals(Path.PARENT_SEGMENT), is(true)); }
@Override public boolean equals( Object obj ) { if (obj == this) return true; if (obj instanceof Path.Segment) { Path.Segment that = (Path.Segment)obj; if (!this.getName().equals(that.getName())) return false; return Math.abs(getIndex()) == Math.abs(that.getIndex()); } return false; }
BasicPathSegment implements Path.Segment { @Override public boolean equals( Object obj ) { if (obj == this) return true; if (obj instanceof Path.Segment) { Path.Segment that = (Path.Segment)obj; if (!this.getName().equals(that.getName())) return false; return Math.abs(getIndex()) == Math.abs(that.getIndex()); } return false; } }
BasicPathSegment implements Path.Segment { @Override public boolean equals( Object obj ) { if (obj == this) return true; if (obj instanceof Path.Segment) { Path.Segment that = (Path.Segment)obj; if (!this.getName().equals(that.getName())) return false; return Math.abs(getIndex()) == Math.abs(that.getIndex()); } return false; } BasicPathSegment( Name name );  BasicPathSegment( Name name,
                             int index ); }
BasicPathSegment implements Path.Segment { @Override public boolean equals( Object obj ) { if (obj == this) return true; if (obj instanceof Path.Segment) { Path.Segment that = (Path.Segment)obj; if (!this.getName().equals(that.getName())) return false; return Math.abs(getIndex()) == Math.abs(that.getIndex()); } return false; } BasicPathSegment( Name name );  BasicPathSegment( Name name,
                             int index ); @Override int getIndex(); @Override Name getName(); @Override boolean hasIndex(); @Override boolean isParentReference(); @Override boolean isSelfReference(); @Override boolean isIdentifier(); @Override int compareTo( Path.Segment that ); @Override int hashCode(); @Override boolean equals( Object obj ); @Override String toString(); @Override String getUnencodedString(); @Override String getString(); @Override String getString( TextEncoder encoder ); @Override String getString( NamespaceRegistry namespaceRegistry ); @Override String getString( NamespaceRegistry namespaceRegistry,
                             TextEncoder encoder ); @Override String getString( NamespaceRegistry namespaceRegistry,
                             TextEncoder encoder,
                             TextEncoder delimiterEncoder ); }
BasicPathSegment implements Path.Segment { @Override public boolean equals( Object obj ) { if (obj == this) return true; if (obj instanceof Path.Segment) { Path.Segment that = (Path.Segment)obj; if (!this.getName().equals(that.getName())) return false; return Math.abs(getIndex()) == Math.abs(that.getIndex()); } return false; } BasicPathSegment( Name name );  BasicPathSegment( Name name,
                             int index ); @Override int getIndex(); @Override Name getName(); @Override boolean hasIndex(); @Override boolean isParentReference(); @Override boolean isSelfReference(); @Override boolean isIdentifier(); @Override int compareTo( Path.Segment that ); @Override int hashCode(); @Override boolean equals( Object obj ); @Override String toString(); @Override String getUnencodedString(); @Override String getString(); @Override String getString( TextEncoder encoder ); @Override String getString( NamespaceRegistry namespaceRegistry ); @Override String getString( NamespaceRegistry namespaceRegistry,
                             TextEncoder encoder ); @Override String getString( NamespaceRegistry namespaceRegistry,
                             TextEncoder encoder,
                             TextEncoder delimiterEncoder );  }