@Override
  public ProblemDescriptor @Nullable [] checkMethod(@NotNull PsiMethod method, @NotNull InspectionManager manager, boolean isOnTheFly) {
    if (method.isConstructor() ||
        PsiTypes.voidType().equals(method.getReturnType()) ||
        AccessModifier.fromModifierList(method.getModifierList()).compareTo(myGlobal.getHighestModifier()) < 0 ||
        (myGlobal.IGNORE_BUILDER_PATTERN && (PropertyUtilBase.isSimplePropertySetter(method) || MethodUtils.isChainable(method))) ||
        method.hasModifierProperty(PsiModifier.NATIVE) ||
        MethodUtils.hasSuper(method) ||
        RefUtil.isImplicitRead(method) ||
        MethodUtils.hasCanIgnoreReturnValueAnnotation(method, method.getContainingFile()) ||
        UnusedDeclarationInspectionBase.isDeclaredAsEntryPoint(method)) {
      return null;
    }

    final boolean[] atLeastOneUsageExists = new boolean[]{false};
    if (UnusedSymbolUtil.processUsages(manager.getProject(), method.getContainingFile(), method, null, u -> {
      if (!atLeastOneUsageExists[0]) atLeastOneUsageExists[0] = true;
      PsiElement element = u.getElement();
      if (element instanceof PsiReferenceExpression) {
        PsiElement parent = element.getParent();
        if (parent instanceof PsiMethodCallExpression) {
          return ExpressionUtils.isVoidContext((PsiExpression)parent);
        }
      }
      return element instanceof PsiMethodReferenceExpression &&
             PsiTypes.voidType().equals(LambdaUtil.getFunctionalInterfaceReturnType((PsiFunctionalExpression)element));
    })) {
      if (atLeastOneUsageExists[0]) {
        return new ProblemDescriptor[]{UnusedReturnValue.createProblemDescriptor(method, manager, null, false, isOnTheFly)};
      }
    }
    return null;
  }
@Override
  public ProblemDescriptor @Nullable [] checkMethod(@NotNull PsiMethod method, @NotNull InspectionManager manager, boolean isOnTheFly)