@Test public void testEquals() { assertFalse(getTestObject().equals(null)); assertFalse(getTestObject().equals("DummyString")); assertTrue(getTestObject().equals(getTestObject())); Note sameObject = getTestObject(); assertTrue(sameObject.equals(sameObject)); Note differentObject = getTestObject(); differentObject.setGUID("Different"); assertFalse(getTestObject().equals(differentObject)); }
@Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (!(objectToCompare instanceof Note)) { return false; } if (!super.equals(objectToCompare)) { return false; } Note note = (Note) objectToCompare; return Objects.equals(getText(), note.getText()) && Objects.equals(getLastUpdate(), note.getLastUpdate()) && Objects.equals(getUser(), note.getUser()); }
Note extends Referenceable { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (!(objectToCompare instanceof Note)) { return false; } if (!super.equals(objectToCompare)) { return false; } Note note = (Note) objectToCompare; return Objects.equals(getText(), note.getText()) && Objects.equals(getLastUpdate(), note.getLastUpdate()) && Objects.equals(getUser(), note.getUser()); } }
Note extends Referenceable { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (!(objectToCompare instanceof Note)) { return false; } if (!super.equals(objectToCompare)) { return false; } Note note = (Note) objectToCompare; return Objects.equals(getText(), note.getText()) && Objects.equals(getLastUpdate(), note.getLastUpdate()) && Objects.equals(getUser(), note.getUser()); } Note();  Note(Note templateNote); }
Note extends Referenceable { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (!(objectToCompare instanceof Note)) { return false; } if (!super.equals(objectToCompare)) { return false; } Note note = (Note) objectToCompare; return Objects.equals(getText(), note.getText()) && Objects.equals(getLastUpdate(), note.getLastUpdate()) && Objects.equals(getUser(), note.getUser()); } Note();  Note(Note templateNote); String getText(); void setText(String text); Date getLastUpdate(); void setLastUpdate(Date lastUpdate); String getUser(); void setUser(String user); @Override String toString(); @Override boolean equals(Object objectToCompare); }
Note extends Referenceable { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (!(objectToCompare instanceof Note)) { return false; } if (!super.equals(objectToCompare)) { return false; } Note note = (Note) objectToCompare; return Objects.equals(getText(), note.getText()) && Objects.equals(getLastUpdate(), note.getLastUpdate()) && Objects.equals(getUser(), note.getUser()); } Note();  Note(Note templateNote); String getText(); void setText(String text); Date getLastUpdate(); void setLastUpdate(Date lastUpdate); String getUser(); void setUser(String user); @Override String toString(); @Override boolean equals(Object objectToCompare);  }