BasicName implements Name { @Override public int compareTo( Name that ) { if (that == this) return 0; int diff = this.getLocalName().compareTo(that.getLocalName()); if (diff != 0) return diff; diff = this.getNamespaceUri().compareTo(that.getNamespaceUri()); return diff; } BasicName( String namespaceUri,
                      String localName ); @Override String getLocalName(); @Override String getNamespaceUri(); @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 ); @Override int compareTo( Name that ); @Override int hashCode(); @Override boolean equals( Object obj ); @Override String toString();  }
@Test( expected = NullPointerException.class ) public void shouldNotSupportNullInCompareTo() { name.compareTo(null); }