### Question:
Post extends Entity implements SubscriptionAwareEntity { public boolean canBeVotedBy(JCUser user, boolean direction) { return direction ? !isVotedUpBy(user) : !isVotedDownBy(user); } protected  Post();  Post(JCUser userCreated, String postContent); int getPostIndexInTopic(); DateTime getCreationDate(); DateTime getModificationDate(); DateTime updateModificationDate(); DateTime updateCreationDate(); DateTime getLastTouchedDate(); JCUser getUserCreated(); @Fields({ @Field(name = POST_CONTENT_FIELD_RU, analyzer = @Analyzer(definition = "russianJtalksAnalyzer")), @Field(name = POST_CONTENT_FIELD_DEF, analyzer = @Analyzer(definition = "defaultJtalksAnalyzer")) }) @FieldBridge(impl = BbCodeFilterBridge.class) String getPostContent(); void setPostContent(String postContent); @ContainedIn Topic getTopic(); void setTopic(Topic topic); List<PostComment> getComments(); void setComments(List<PostComment> comments); void addComment(PostComment comment); int getRating(); void setRating(int rating); Set<PostVote> getVotes(); void setVotes(Set<PostVote> votes); void putVote(PostVote vote); boolean isVotedUpBy(JCUser user); boolean isVotedDownBy(JCUser user); boolean canBeVotedBy(JCUser user, boolean direction); int calculateRatingChanges(PostVote vote); List<PostComment> getNotRemovedComments(); @Override Set<JCUser> getSubscribers(); @Override String getUrlSuffix(); @Override String getUnsubscribeLinkForSubscribersOf(Class<T> clazz); static final String URL_SUFFIX; static final int MAX_LENGTH; static final int MIN_LENGTH; static final String POST_CONTENT_FIELD_RU; static final String POST_CONTENT_FIELD_DEF; }### Answer:
@Test public void canBeVotedByShouldReturnTrueIfUserTryToVoteUpAndStillNotVoted() { Post post = new Post(); assertTrue(post.canBeVotedBy(ObjectsFactory.getDefaultUser(), true)); }
@Test public void canBeVotedByShouldReturnTrueIfUserTryToVoteDownAndStillNotVoted() { Post post = new Post(); assertTrue(post.canBeVotedBy(ObjectsFactory.getDefaultUser(), false)); }