### Question:
Branch extends org.jtalks.common.model.entity.Branch implements SubscriptionAwareEntity { public Topic getPreviousTopic(Topic topic) { int index = this.getTopicIndexInList(topic); if (index == 0) { return null; } else { return topics.get(index - 1); } } protected  Branch();  Branch(String name, String description); Topic getNextTopic(Topic topic); Topic getPreviousTopic(Topic topic); List<Topic> getTopics(); void addTopic(Topic topic); void deleteTopic(Topic topic); int getTopicCount(); int getPostCount(); @Override Set<JCUser> getSubscribers(); void setSubscribers(Set<JCUser> subscribers); @Override String getUrlSuffix(); @Override String getUnsubscribeLinkForSubscribersOf(Class<T> clazz); void setTopicsCount(Integer topicsCount); void setPostsCount(Integer postsCount); boolean isUnreadPosts(); void setUnreadPosts(boolean unreadPosts); Post getLastPost(); void setLastPost(Post lastPost); boolean isLastPost(Post checkedPost); void clearLastPost(); static final int BRANCH_NAME_MAX_LENGTH; static final int BRANCH_DESCRIPTION_MAX_LENGTH; static final String URL_SUFFIX; }### Answer:
@Test public void testPreviousTopicRetrieval() { assertEquals(branch.getPreviousTopic(first), null); assertEquals(branch.getPreviousTopic(second), first); assertEquals(branch.getPreviousTopic(third), second); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNextTopicRetrievalError() { branch.getPreviousTopic(new Topic(null, null)); }