BranchStatisticService { List<Branch> getBranchesToProcess(Long repositoryId) { List<Branch> branches = branchRepository.findByRepositoryIdAndDeletedFalseAndNameNotNullAndNameNot(repositoryId, PRIMARY_BRANCH); return branches; }  void computeAndSaveBranchStatistics(Long repositoryId); void computeAndSaveBranchStatistics(Branch branch); List<TextUnitDTO> getTextUnitDTOsForBranch(Branch branch);  }
@Test public void getBranchesToCheck() throws Exception { BranchTestData branchTestData = new BranchTestData(testIdWatcher); List<Branch> branchesToCheck = branchStatisticService.getBranchesToProcess(branchTestData.getRepository().getId()); assertEquals("branch1", branchesToCheck.get(0).getName()); assertEquals("branch2", branchesToCheck.get(1).getName()); assertEquals(2, branchesToCheck.size()); }