### Question:
OkrBranchService { public OkrBranch findById(Long id) { return this.okrBranchRepository.findByIdOrThrow(id); } @Autowired  OkrBranchService(
      OkrBranchRepository okrBranchRepository, ActivityService activityService); OkrBranch findById(Long id); OkrBranch create(OkrBranch okrBranch, User user); OkrBranch update(long branchId, OkrBranch okrBranch, User user); void delete(Long id, User user);  }### Answer:
@Test(expected = EntityNotFoundException.class) public void findById_expectEntityNotFoundExceptionIfItNotExists() { when(okrBranchRepository.findByIdOrThrow(anyLong())).thenThrow(EntityNotFoundException.class); okrBranchService.findById(444L); }
@Test public void findById_expectEntityFound() { OkrBranch actual = okrBranchService.findById(okrBranchId); Assert.assertEquals(okrBranch, actual); }