void (@NotNull PsiIfStatement ifStatement, @NotNull PsiExpression condition, @NotNull PsiExpression arrayExpression) { if (ifStatement.getElseBranch() != null) return; if (!(ControlFlowUtils.stripBraces(ifStatement.getThenBranch()) instanceof PsiForeachStatement forEach)) return; if (EquivalenceChecker.getCanonicalPsiEquivalence().expressionsAreEquivalent(forEach.getIteratedValue(), arrayExpression)) { holder.problem(condition, InspectionGadgetsBundle.message("inspection.redundant.length.check.display.name")).fix(new SimplifyBooleanExpressionFix(condition, true)).register(); } }