### Question:
Branch extends org.jtalks.common.model.entity.Branch implements SubscriptionAwareEntity { @Override public <T extends SubscriptionAwareEntity> String getUnsubscribeLinkForSubscribersOf(Class<T> clazz) { if (Branch.class.isAssignableFrom(clazz)) { return String.format("/branches/%s/unsubscribe", getId()); } return null; } 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 getUnsubscribeLinkForSubscribersOfBranchShouldReturnBranchUnsubscribeLink() { branch.setId(1); assertEquals(branch.getUnsubscribeLinkForSubscribersOf(Branch.class), "/branches/1/unsubscribe"); }
@Test public void getUnsubscribeLinkForSubscribersOfBranchSubclassShouldReturnBranchUnsubscribeLink() { class BranchSubClass extends Branch { } branch.setId(1); assertEquals(branch.getUnsubscribeLinkForSubscribersOf(BranchSubClass.class), "/branches/1/unsubscribe"); }
@Test public void getUnsubscribeLinkForSubscribersOfTopicShouldReturnNull() { assertNull(branch.getUnsubscribeLinkForSubscribersOf(Topic.class)); }
@Test public void getUnsubscribeLinkForSubscribersOfPostShouldReturnNull() { assertNull(branch.getUnsubscribeLinkForSubscribersOf(Post.class)); }