### Question:
TransactionalSubscriptionService implements SubscriptionService { @Override public void toggleBranchSubscription(Branch branch) { JCUser current = userService.getCurrentUser(); if (branch.getSubscribers().contains(current)) { branch.getSubscribers().remove(current); } else { branch.getSubscribers().add(current); } branchDao.saveOrUpdate(branch); } TransactionalSubscriptionService(UserService userService,
                                            BranchDao branchDao,
                                            TopicDao topicDao); @Override void toggleTopicSubscription(Topic topic); @Override void toggleBranchSubscription(Branch branch); @Override void unsubscribeFromBranch(Branch branch); @Override void toggleSubscription(SubscriptionAwareEntity entityToSubscribe); @Override Collection<JCUser> getAllowedSubscribers(SubscriptionAwareEntity entity); @Override void subscribe(SubscriptionAwareEntity entityToSubscribe);  }### Answer:
@Test public void testToggleBranchSubscription() { service.toggleBranchSubscription(branch); assertTrue(branch.getSubscribers().contains(user)); }
@Test public void testToggleBranchUnsubscription() { branch.getSubscribers().add(user); service.toggleBranchSubscription(branch); assertFalse(branch.getSubscribers().contains(user)); }