### Question:
EntityCrawlerService { public Cycle getCycleOfUnit(OkrUnit departmentToCheck) { if (departmentToCheck instanceof OkrCompany) { return this.getCycleOfCompany((OkrCompany) departmentToCheck); } else { return this.getCycleOfUnit(((OkrChildUnit) departmentToCheck).getParentOkrUnit()); } }  Cycle getCycleOfCompany(OkrCompany okrCompanyToCheck); Cycle getCycleOfUnit(OkrUnit departmentToCheck); Cycle getCycleOfObjective(Objective objectiveToCheck); Cycle getCycleOfKeyResult(KeyResult keyResultToCheck); OkrCompany getCompanyOfUnit(OkrChildUnit departmentToCheck);  }### Answer:
@Test public void getCycleOfDepartment_companyIsFirstParent_expectedCycle() { Cycle actualCycle = entityCrawlerService.getCycleOfUnit(departmentChildFirstDegree); Assert.assertEquals(cycle, actualCycle); }
@Test public void getCycleOfDepartment_companyIsNestedParent_expectedCycle() { Cycle actualCycle = entityCrawlerService.getCycleOfUnit(okrDepartmentChildSecondDegree); Assert.assertEquals(cycle, actualCycle); }