### Question:
PostComment extends Entity { public boolean isCreatedBy(JCUser user) { return this.getAuthor() != null && ObjectUtils.nullSafeEquals(this.getAuthor(), user); }  JCUser getAuthor(); void setAuthor(JCUser author); boolean isCreatedBy(JCUser user); DateTime getCreationDate(); void setCreationDate(DateTime creationDate); String getBody(); void setBody(String body); Post getOwnerPost(); Post getPost(); void setPost(Post post); Map<String, String> getAttributes(); void setAttributes(Map<String, String> attributes); void putAttribute(String attributeName, String attributeValue); void putAllAttributes(Map<String, String> attributes); DateTime getDeletionDate(); void setDeletionDate(DateTime deletionDate); DateTime getModificationDate(); void setModificationDate(DateTime modificationDate); JCUser getUserChanged(); void setUserChanged(JCUser userChanged); static final int BODY_MIN_LENGTH; static final int BODY_MAX_LENGTH; }### Answer:
@Test public void isCreatedBy_successfulPath() { PostComment comment = commentBy(userWithUuid("11")); assertTrue(comment.isCreatedBy(userWithUuid("11"))); }
@Test public void isCreatedByIsFalseIfUsersNotEqual() { PostComment comment = commentBy(userWithUuid("11")); assertFalse(comment.isCreatedBy(userWithUuid("not-equal"))); }
@Test public void isCreatedByShouldFailIfNullPassed() { PostComment comment = commentBy(userWithUuid("11")); assertFalse(comment.isCreatedBy(null)); }
@Test public void isCreatedByShouldFailIfAuthorIsNull() { PostComment comment = commentBy(null); assertFalse(comment.isCreatedBy(userWithUuid("11"))); }
@Test public void isCreatedByShouldFailIfAuthorIsNullAndNullPassed() { PostComment comment = commentBy(null); assertFalse(comment.isCreatedBy(null)); }