private boolean checkIfConjecturable(Map<HierarchyRelatedService, ServiceRelations> serviceRelationsMap,
                                         List<HierarchyRelatedService> services,
                                         HierarchyRelatedService conjecturalService,
                                         int maxDepth) {
        if (maxDepth < 1) {
            return false;
        }
        maxDepth--;
        for (HierarchyRelatedService service : services) {
            if (!service.equals(conjecturalService)) {
                List<HierarchyRelatedService> lowerServices = serviceRelationsMap.get(service).lowerServices;
                if (lowerServices.contains(conjecturalService)) {
                    return true;
                } else {
                    return checkIfConjecturable(serviceRelationsMap, lowerServices, conjecturalService, maxDepth);
                }
            }
        }
        return false;
    }
@return return the related service hierarchy recursively, e.g. A-B-C, query A will return A-B, B-C
If the relation could be conjectured will be removed, e.g. A-B-C-D and A-D, query A will return A-B, B-C, C-D because A-D could be conjectured.
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/HierarchyQueryService.java