### Question:
TopicDraft extends Entity { public void setPollTitle(String pollTitle) { this.pollTitle = pollTitle; } TopicDraft();  TopicDraft(JCUser topicStarter, String title, String content); String getTitle(); void setTitle(String title); String getContent(); void setContent(String content); JCUser getTopicStarter(); void setTopicStarter(JCUser topicStarter); DateTime getLastSaved(); void setLastSaved(DateTime lastSaved); String getPollTitle(); void setPollTitle(String pollTitle); String getPollItemsValue(); void setPollItemsValue(String pollItemsValue); long getBranchId(); void setBranchId(long branchId); String getTopicType(); void setTopicType(String topicType); void updateLastSavedTime(); boolean isCodeReview(); boolean isPlugable();  }### Answer:
@Test public void validationOfDraftWithoutPollTitleShouldPass() { TopicDraft draft = ObjectsFactory.getDefaultTopicDraft(); draft.setPollTitle(null); Set<ConstraintViolation<TopicDraft>> constraintViolations = validator.validate(draft); assertEquals(constraintViolations.size(), 0); }
@Test public void validationOfDraftWithTooLongPollTitleShouldFail() { TopicDraft draft = ObjectsFactory.getDefaultTopicDraft(); draft.setPollTitle(RandomStringUtils.random(121)); Set<ConstraintViolation<TopicDraft>> constraintViolations = validator.validate(draft); assertEquals(constraintViolations.size(), 1); }