@Test public void testEquals() { assertFalse(getTestObject().equals(null)); assertFalse(getTestObject().equals("DummyString")); assertTrue(getTestObject().equals(getTestObject())); InformalTag sameObject = getTestObject(); assertTrue(sameObject.equals(sameObject)); InformalTag differentObject = getTestObject(); differentObject.setName("Different"); assertFalse(getTestObject().equals(differentObject)); differentObject = getTestObject(); differentObject.setGUID("Different"); assertFalse(getTestObject().equals(differentObject)); }
@Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (!(objectToCompare instanceof InformalTag)) { return false; } if (!super.equals(objectToCompare)) { return false; } InformalTag that = (InformalTag) objectToCompare; return isPrivateTag() == that.isPrivateTag() && Objects.equals(getName(), that.getName()) && Objects.equals(getDescription(), that.getDescription()) && Objects.equals(getUser(), that.getUser()); }
InformalTag extends ElementHeader { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (!(objectToCompare instanceof InformalTag)) { return false; } if (!super.equals(objectToCompare)) { return false; } InformalTag that = (InformalTag) objectToCompare; return isPrivateTag() == that.isPrivateTag() && Objects.equals(getName(), that.getName()) && Objects.equals(getDescription(), that.getDescription()) && Objects.equals(getUser(), that.getUser()); } }
InformalTag extends ElementHeader { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (!(objectToCompare instanceof InformalTag)) { return false; } if (!super.equals(objectToCompare)) { return false; } InformalTag that = (InformalTag) objectToCompare; return isPrivateTag() == that.isPrivateTag() && Objects.equals(getName(), that.getName()) && Objects.equals(getDescription(), that.getDescription()) && Objects.equals(getUser(), that.getUser()); } InformalTag();  InformalTag(InformalTag templateInformalTag); }
InformalTag extends ElementHeader { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (!(objectToCompare instanceof InformalTag)) { return false; } if (!super.equals(objectToCompare)) { return false; } InformalTag that = (InformalTag) objectToCompare; return isPrivateTag() == that.isPrivateTag() && Objects.equals(getName(), that.getName()) && Objects.equals(getDescription(), that.getDescription()) && Objects.equals(getUser(), that.getUser()); } InformalTag();  InformalTag(InformalTag templateInformalTag); boolean isPublic(); void setPublic(boolean aPublic); boolean isPrivateTag(); void setPrivateTag(boolean privateTag); String getUser(); void setUser(String user); String getName(); void setName(String name); String getDescription(); void setDescription(String tagDescription); @Override String toString(); @Override boolean equals(Object objectToCompare); }
InformalTag extends ElementHeader { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (!(objectToCompare instanceof InformalTag)) { return false; } if (!super.equals(objectToCompare)) { return false; } InformalTag that = (InformalTag) objectToCompare; return isPrivateTag() == that.isPrivateTag() && Objects.equals(getName(), that.getName()) && Objects.equals(getDescription(), that.getDescription()) && Objects.equals(getUser(), that.getUser()); } InformalTag();  InformalTag(InformalTag templateInformalTag); boolean isPublic(); void setPublic(boolean aPublic); boolean isPrivateTag(); void setPrivateTag(boolean privateTag); String getUser(); void setUser(String user); String getName(); void setName(String name); String getDescription(); void setDescription(String tagDescription); @Override String toString(); @Override boolean equals(Object objectToCompare);  }