### Question:
TransactionalForumStructureService implements ForumStructureService { @Override public void removeBranch(PoulpeBranch branch) throws NoConnectionToJcommuneException,JcommuneRespondedWithErrorException,JcommuneUrlNotConfiguredException { Jcommune jcommune = (Jcommune) componentDao.getByType(ComponentType.FORUM); jCommuneNotifier.notifyAboutBranchDelete(jcommune.getUrl(), branch); PoulpeSection section = (PoulpeSection) branch.getSection(); section.deleteBranch(branch); sectionDao.saveOrUpdate(section); branchDao.delete(branch); } TransactionalForumStructureService(SectionDao sectionDao, BranchDao branchDao, ComponentDao componentDao,
            JCommuneNotifier jCommuneNotifier); @Override void saveJcommune(Jcommune jcommune); @Override Jcommune getJcommune(); @Override void removeBranch(PoulpeBranch branch); @Override void moveBranch(PoulpeBranch branch, PoulpeSection toSection); @Override Jcommune deleteSectionWithBranches(PoulpeSection section); @Override void deleteSectionAndMoveBranches(PoulpeSection toRemove, PoulpeSection toReceiveBranches); @Override PoulpeBranch saveBranch(PoulpeSection inSection, PoulpeBranch notYetSavedBranch); @Override void moveBranch(PoulpeBranch branch, PoulpeBranch target); @Override void moveSection(PoulpeSection section, PoulpeSection target);  }### Answer:
@Test(dataProvider = "provideJcommuneWithSectionsAndBranches") public void removeBranchShouldRemoveFromDb(Jcommune jcommuneWithoutSpy) throws Exception { Jcommune jcommune = spy(jcommuneWithoutSpy); doReturn("").when(jcommune).getUrl(); PoulpeSection section = jcommune.getSections().get(0); PoulpeBranch branchToRemove = section.getBranch(0); doReturn(jcommune).when(componentDao).getByType(ComponentType.FORUM); sut.removeBranch(branchToRemove); verify(branchDao).delete(branchToRemove); }
@Test(dataProvider = "provideJcommuneWithSectionsAndBranches") public void removeBranchShouldRemoveFromSection(Jcommune jcommuneWithoutSpy) throws Exception { Jcommune jcommune = spy(jcommuneWithoutSpy); doReturn("").when(jcommune).getUrl(); PoulpeSection section = jcommune.getSections().get(0); PoulpeBranch branchToRemove = section.getBranch(0); doReturn(jcommune).when(componentDao).getByType(ComponentType.FORUM); sut.removeBranch(branchToRemove); assertFalse(section.getBranches().contains(branchToRemove)); verify(sectionDao).saveOrUpdate(section); }