@Test public void testEquals() { Row oldRow1 = new Row().stringColumn("name", "old_name"); Row oldRow2 = new Row(ImmutableMap.of("name", Atom.string("old_name"))); Row newRow1 = new Row().stringColumn("name", "new_name"); Row newRow2 = new Row(ImmutableMap.of("name", Atom.string("new_name"))); new EqualsTester() .addEqualityGroup(new RowUpdate(), new RowUpdate(null, null)) .addEqualityGroup(new RowUpdate(oldRow1, null), new RowUpdate().setOld(oldRow2)) .addEqualityGroup(new RowUpdate(null, newRow1), new RowUpdate().setNew(newRow2)) .testEquals(); }
@Override public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof RowUpdate)) { return false; } RowUpdate rowUpdate = (RowUpdate) other; return Objects.equals(oldRow, rowUpdate.getOld()) && Objects.equals(newRow, rowUpdate.getNew()); }
RowUpdate { @Override public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof RowUpdate)) { return false; } RowUpdate rowUpdate = (RowUpdate) other; return Objects.equals(oldRow, rowUpdate.getOld()) && Objects.equals(newRow, rowUpdate.getNew()); } }
RowUpdate { @Override public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof RowUpdate)) { return false; } RowUpdate rowUpdate = (RowUpdate) other; return Objects.equals(oldRow, rowUpdate.getOld()) && Objects.equals(newRow, rowUpdate.getNew()); } RowUpdate();  RowUpdate(Row oldRow, Row newRow); }
RowUpdate { @Override public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof RowUpdate)) { return false; } RowUpdate rowUpdate = (RowUpdate) other; return Objects.equals(oldRow, rowUpdate.getOld()) && Objects.equals(newRow, rowUpdate.getNew()); } RowUpdate();  RowUpdate(Row oldRow, Row newRow); Row getOld(); RowUpdate setOld(Row oldRow); Row getNew(); RowUpdate setNew(Row newRow); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString(); }
RowUpdate { @Override public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof RowUpdate)) { return false; } RowUpdate rowUpdate = (RowUpdate) other; return Objects.equals(oldRow, rowUpdate.getOld()) && Objects.equals(newRow, rowUpdate.getNew()); } RowUpdate();  RowUpdate(Row oldRow, Row newRow); Row getOld(); RowUpdate setOld(Row oldRow); Row getNew(); RowUpdate setNew(Row newRow); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString();  }