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