RyaType implements Comparable<RyaType> { @Override public int hashCode() { return Objects.hash(dataType, data, language); } RyaType();  RyaType(final String data);  RyaType(final IRI dataType, final String data);  RyaType(final IRI dataType, final String data, final String language); IRI getDataType(); String getData(); void setDataType(final IRI dataType); void setData(final String data); String getLanguage(); void setLanguage(final String language); @Override String toString(); @Override boolean equals(final Object o); @Override int hashCode(); @Override int compareTo(final RyaType o);  }
@Test public void testHashCodeEquals() throws Exception { Assert.assertEquals("Same data and same type should yield same hash code.", a.hashCode(), same.hashCode()); Assert.assertEquals("Same type and both null data should yield same hash code.", nullData.hashCode(), new RyaType(XMLSchema.STRING, null).hashCode()); Assert.assertEquals("Same data and both null type should yield same hash code.", nullType.hashCode(), new RyaType(null, "http: Assert.assertEquals("Null type and null data should yield same hash code.", nullBoth.hashCode(), new RyaType(null, null).hashCode()); }