@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()); }
@Override public int hashCode() { int result = myKeyspace != null ? myKeyspace.hashCode() : 0; result = 31 * result + (myTable != null ? myTable.hashCode() : 0); return result; }
TableReference { @Override public int hashCode() { int result = myKeyspace != null ? myKeyspace.hashCode() : 0; result = 31 * result + (myTable != null ? myTable.hashCode() : 0); return result; } }
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); }
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(); }
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();  }