private void checkReturnValueSanity(PsiElement anchor, PsiElement body) {
      LongRangeSet range;
      if (body instanceof PsiExpression expression) {
        range = DfLongType.extractRange(CommonDataflow.getDfType(expression));
      } else if (body instanceof PsiCodeBlock block) {
        range = StreamEx.of(PsiUtil.findReturnStatements(block))
          .map(PsiReturnStatement::getReturnValue)
          .nonNull()
          .map(CommonDataflow::getDfType)
          .map(DfLongType::extractRange)
          .reduce(LongRangeSet.empty(), LongRangeSet::join);
      } else {
        return;
      }
      if (range.isEmpty() || range.equals(LongRangeSet.point(0))) return;
      if (range.min() >= 0) {
        registerError(anchor, InspectionGadgetsBundle.message("suspicious.comparator.compare.descriptor.non.negative"));
      }
      else if (range.max() <= 0) {
        registerError(anchor, InspectionGadgetsBundle.message("suspicious.comparator.compare.descriptor.non.positive"));
      }
    }
private void checkReturnValueSanity(PsiElement anchor, PsiElement body)