### Question:
IdName extends Hash { @Override public final int hashCode() { return id.hashCode() ^ name.hashCode(); } IdName( Integer id, String name );  IdName( String name ); final Integer getId(); final String getName(); @Override final String toString(); @Override final boolean equals( Object obj ); @Override final int hashCode();  }### Answer:
@Test public void hashCodeObject() { assertEquals( new IdName( 1, "foo" ).hashCode(), new IdName( 1, "foo" ).hashCode() ); assertEquals( new IdName( 2, "foo" ).hashCode(), new IdName( 2, "foo" ).hashCode() ); assertEquals( new IdName( 1, "bar" ).hashCode(), new IdName( 1, "bar" ).hashCode() ); assertEquals( new IdName( 2, "bar" ).hashCode(), new IdName( 2, "bar" ).hashCode() ); }