### Question:
TableReference { @Override public int hashCode() { int result = myKeyspace != null ? myKeyspace.hashCode() : 0; result = 31 * result + (myTable != null ? myTable.hashCode() : 0); return result; } TableReference(String keyspace, String table); String getTable(); String getKeyspace(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test public void testSameTableIsEqual() { TableReference tableReference1 = new TableReference("keyspace", "table"); TableReference tableReference2 = new TableReference("keyspace", "table"); assertThat(tableReference1).isEqualTo(tableReference2); assertThat(tableReference1.hashCode()).isEqualTo(tableReference2.hashCode()); }
@Test public void testDifferentKeyspacesNotEqual() { TableReference tableReference1 = new TableReference("keyspace", "table"); TableReference tableReference2 = new TableReference("keyspace2", "table"); assertThat(tableReference1).isNotEqualTo(tableReference2); assertThat(tableReference1.hashCode()).isNotEqualTo(tableReference2.hashCode()); }
@Test public void testDifferentTablesNotEqual() { TableReference tableReference1 = new TableReference("keyspace", "table"); TableReference tableReference2 = new TableReference("keyspace", "table2"); assertThat(tableReference1).isNotEqualTo(tableReference2); assertThat(tableReference1.hashCode()).isNotEqualTo(tableReference2.hashCode()); }