private boolean areAllImplementationsEmpty(@NotNull RefOverridable reference) {
    if (reference instanceof RefMethod refMethod) {
      if (refMethod.hasBody() && !isBodyEmpty(refMethod)) return false;
    }
    else if (reference instanceof RefFunctionalExpression refFunctionalExpression) {
      if (!refFunctionalExpression.hasEmptyBody()) return false;
    }

    for (RefOverridable derivedReference : reference.getDerivedReferences()) {
      if (!areAllImplementationsEmpty(derivedReference)) return false;
    }

    return true;
  }
private boolean areAllImplementationsEmpty(@NotNull RefOverridable reference)