boolean (@NotNull RefOverridable reference) { if (reference instanceof RefMethod) { if (((RefMethod)reference).hasBody() && !isBodyEmpty((RefMethod)reference)) return false; } else if (reference instanceof RefFunctionalExpression) { if (!((RefFunctionalExpression)reference).hasEmptyBody()) return false; } for (RefOverridable derivedReference : reference.getDerivedReferences()) { if (!areAllImplementationsEmpty(derivedReference)) return false; } return true; }