boolean (@Nullable PsiCodeBlock block, @NotNull PsiVariable variable, @NotNull Set<MethodSignature> checkedMethods, boolean strict) { if (block == null) { return false; } int assignmentCount = 0; for (final PsiStatement statement : block.getStatements()) { if (statementAssignsVariableOrFails(statement, variable, checkedMethods, strict)) { if (strict) { assignmentCount++; } else { return true; } } } return assignmentCount == 1; }