### Question:
TransactionalSectionService extends AbstractTransactionalEntityService<PoulpeSection, SectionDao> implements SectionService { @Override public boolean deleteAndMoveBranchesTo(PoulpeSection victim, PoulpeSection recipient) { if (victim.getId() == recipient.getId()) { throw new IllegalArgumentException("Victim and recipient can't be the same section"); } return dao.deleteAndMoveBranchesTo(victim, recipient); } TransactionalSectionService(SectionDao sectionDao); @Override List<PoulpeSection> getAll(); @Override void saveSection(PoulpeSection section); @Override boolean deleteRecursively(PoulpeSection victim); @Override boolean deleteAndMoveBranchesTo(PoulpeSection victim, PoulpeSection recipient);  }### Answer:
@Test public void deleteAndMoveBranchesToTest() { PoulpeSection victim = buildFakeSection(SECTION_ID); PoulpeSection recipient = buildFakeSection(SECTION_ID + 1); boolean expected = true; when(sectionDao.deleteAndMoveBranchesTo(victim, recipient)).thenReturn(expected); boolean actual = sectionService.deleteAndMoveBranchesTo(victim, recipient); verify(sectionDao).deleteAndMoveBranchesTo(victim, recipient); assertEquals(actual, expected); }
@Test (expectedExceptions=IllegalArgumentException.class) public void deleteAndMoveBranchesToExceptionTest() { final long victimId = SECTION_ID; PoulpeSection victim = buildFakeSection(victimId); PoulpeSection recipient = buildFakeSection(victimId); boolean expected = true; when(sectionDao.deleteAndMoveBranchesTo(victim, recipient)).thenReturn(expected); boolean actual = sectionService.deleteAndMoveBranchesTo(victim, recipient); verify(sectionDao).deleteAndMoveBranchesTo(victim, recipient); assertEquals(actual, expected); }