boolean moveTo(PsiStatement targetStatement, boolean returnAtTheEnd) {
      if (checkingApplicability && !isEmpty()) {
        return false; // optimization
      }
      if (targetStatement instanceof PsiBlockStatement blockStatement) {
        return moveToBlock(blockStatement, returnAtTheEnd);
      }
      if (targetStatement instanceof PsiIfStatement ifStatement) {
        return moveToIf(ifStatement);
      }
      if (targetStatement instanceof PsiConditionalLoopStatement loop) {
        return moveToConditionalLoop(loop);
      }
      if (targetStatement instanceof PsiForeachStatement foreachStatement) {
        return moveToForeach(foreachStatement);
      }
      if (targetStatement instanceof PsiSwitchStatement switchStatement) {
        return moveToSwitch(switchStatement);
      }
      if (targetStatement instanceof PsiTryStatement tryStatement) {
        return moveToTry(tryStatement, returnAtTheEnd);
      }
      if (targetStatement instanceof PsiLabeledStatement labeledStatement) {
        return moveToLabeled(labeledStatement, returnAtTheEnd);
      }
      if (targetStatement instanceof PsiExpressionStatement expressionStatement) {
        return inlineExpression(expressionStatement);
      }
      if (targetStatement instanceof PsiThrowStatement ||
          targetStatement instanceof PsiReturnStatement ||
          targetStatement instanceof PsiBreakStatement ||
          targetStatement instanceof PsiContinueStatement) {
        return true;
      }
      return false;
    }
boolean moveTo(PsiStatement targetStatement, boolean returnAtTheEnd)