@Test public void testEquals() { assertFalse(getTestObject().equals(null)); assertFalse(getTestObject().equals("DummyString")); assertTrue(getTestObject().equals(getTestObject())); Meaning sameObject = getTestObject(); assertTrue(sameObject.equals(sameObject)); Meaning differentObject = getTestObject(); differentObject.setGUID("Different"); assertFalse(getTestObject().equals(differentObject)); }
@Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (!(objectToCompare instanceof Meaning)) { return false; } if (!super.equals(objectToCompare)) { return false; } Meaning meaning = (Meaning) objectToCompare; return Objects.equals(getName(), meaning.getName()) && Objects.equals(getDescription(), meaning.getDescription()); }
Meaning extends ElementHeader { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (!(objectToCompare instanceof Meaning)) { return false; } if (!super.equals(objectToCompare)) { return false; } Meaning meaning = (Meaning) objectToCompare; return Objects.equals(getName(), meaning.getName()) && Objects.equals(getDescription(), meaning.getDescription()); } }
Meaning extends ElementHeader { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (!(objectToCompare instanceof Meaning)) { return false; } if (!super.equals(objectToCompare)) { return false; } Meaning meaning = (Meaning) objectToCompare; return Objects.equals(getName(), meaning.getName()) && Objects.equals(getDescription(), meaning.getDescription()); } Meaning();  Meaning(Meaning templateMeaning); }
Meaning extends ElementHeader { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (!(objectToCompare instanceof Meaning)) { return false; } if (!super.equals(objectToCompare)) { return false; } Meaning meaning = (Meaning) objectToCompare; return Objects.equals(getName(), meaning.getName()) && Objects.equals(getDescription(), meaning.getDescription()); } Meaning();  Meaning(Meaning templateMeaning); String getName(); void setName(String name); String getDescription(); void setDescription(String description); @Override String toString(); @Override boolean equals(Object objectToCompare); }
Meaning extends ElementHeader { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (!(objectToCompare instanceof Meaning)) { return false; } if (!super.equals(objectToCompare)) { return false; } Meaning meaning = (Meaning) objectToCompare; return Objects.equals(getName(), meaning.getName()) && Objects.equals(getDescription(), meaning.getDescription()); } Meaning();  Meaning(Meaning templateMeaning); String getName(); void setName(String name); String getDescription(); void setDescription(String description); @Override String toString(); @Override boolean equals(Object objectToCompare);  }