@Test public void testEquals() { assertFalse(getTestObject().equals(null)); assertFalse(getTestObject().equals("DummyString")); assertTrue(getTestObject().equals(getTestObject())); CommentResponse sameObject = getTestObject(); assertTrue(sameObject.equals(sameObject)); CommentResponse differentObject = getTestObject(); differentObject.setReplyCount(8); assertFalse(getTestObject().equals(differentObject)); }
@Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (objectToCompare == null || getClass() != objectToCompare.getClass()) { return false; } CommentResponse that = (CommentResponse) objectToCompare; return getReplyCount() == that.getReplyCount() && Objects.equals(getComment(), that.getComment()); }
CommentResponse extends OCFOMASAPIResponse { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (objectToCompare == null || getClass() != objectToCompare.getClass()) { return false; } CommentResponse that = (CommentResponse) objectToCompare; return getReplyCount() == that.getReplyCount() && Objects.equals(getComment(), that.getComment()); } }
CommentResponse extends OCFOMASAPIResponse { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (objectToCompare == null || getClass() != objectToCompare.getClass()) { return false; } CommentResponse that = (CommentResponse) objectToCompare; return getReplyCount() == that.getReplyCount() && Objects.equals(getComment(), that.getComment()); } CommentResponse();  CommentResponse(CommentResponse template); }
CommentResponse extends OCFOMASAPIResponse { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (objectToCompare == null || getClass() != objectToCompare.getClass()) { return false; } CommentResponse that = (CommentResponse) objectToCompare; return getReplyCount() == that.getReplyCount() && Objects.equals(getComment(), that.getComment()); } CommentResponse();  CommentResponse(CommentResponse template); Comment getComment(); void setComment(Comment comment); int getReplyCount(); void setReplyCount(int replyCount); @Override String toString(); @Override boolean equals(Object objectToCompare); @Override int hashCode(); }
CommentResponse extends OCFOMASAPIResponse { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (objectToCompare == null || getClass() != objectToCompare.getClass()) { return false; } CommentResponse that = (CommentResponse) objectToCompare; return getReplyCount() == that.getReplyCount() && Objects.equals(getComment(), that.getComment()); } CommentResponse();  CommentResponse(CommentResponse template); Comment getComment(); void setComment(Comment comment); int getReplyCount(); void setReplyCount(int replyCount); @Override String toString(); @Override boolean equals(Object objectToCompare); @Override int hashCode();  }