### Question:
SchemaSource { @Override public int hashCode() { return source.getSystemId().hashCode(); } SchemaSource(final InputStream inputStream, final String systemId); Source getSource(); @Override String toString(); @Override int hashCode(); @Override boolean equals(final Object obj);  }### Answer:
@Test public void testHashCode() { final int hashCode = schemaSource.hashCode(); assertEquals("Unexpected hash code value.", SYSTEM_ID.hashCode(), hashCode); }
@Test public void hashCodeRepeatable() { final int hashCode = schemaSource.hashCode(); for (int i = 0; i < 10; i++) { assertEquals("Hash code is not repeatable", hashCode, schemaSource.hashCode()); } }
@Test public void hashCodeConsistentWithEquals() { final SchemaSource schemaSource2 = new SchemaSource(INPUT_STREAM, "another id"); assertFalse("Expected different hash codes for not equal objects", schemaSource.hashCode() == schemaSource2.hashCode()); }