public static boolean isExecutedOnceInLoop(PsiStatement statement, PsiLoopStatement loop) {
    if (flowBreaksLoop(statement, loop)) return true;
    if (loop instanceof PsiForStatement forLoop) {
      // Check that we're inside counted loop which increments some loop variable and
      // the code is executed under condition like if(var == something)
      PsiDeclarationStatement initialization = ObjectUtils.tryCast(forLoop.getInitialization(), PsiDeclarationStatement.class);
      PsiStatement update = forLoop.getUpdate();
      if (initialization != null && update != null) {
        PsiLocalVariable variable = StreamEx.of(initialization.getDeclaredElements()).select(PsiLocalVariable.class)
          .findFirst(var -> LoopDirection.evaluateLoopDirection(var, update) != null).orElse(null);
        if (variable != null) {
          boolean hasLoopVarCheck = conditions(statement).select(PsiBinaryExpression.class)
            .filter(binOp -> binOp.getOperationTokenType().equals(JavaTokenType.EQEQ))
            .anyMatch(binOp -> ExpressionUtils.getOtherOperand(binOp, variable) != null);
          if (hasLoopVarCheck) {
            return ContainerUtil.and(VariableAccessUtils.getVariableReferences(variable), expression -> 
              PsiTreeUtil.isAncestor(update, expression, false) || !PsiUtil.isAccessedForWriting(expression));
          }
        }
      }
    }
    return false;
  }
public static boolean isExecutedOnceInLoop(PsiStatement statement, PsiLoopStatement loop)