code: protected static Span findRootOrServerSpan(String tenantId, Span span, SpanCache spanCache) {
          while (span != null &&
                  !span.serverSpan() && !span.topLevelSpan()) {
              span = spanCache.get(tenantId, span.getParentId());
          }
          return span;
      }
docs: This method identifies the root or enclosing server span that contains the
  supplied client span.
  
  @param tenantId The tenant id
  @param span The client span
  @param spanCache The span cache
  @return The root or enclosing server span, or null if not found