private static void replaceArrayAccess(
      PsiElement element, String contentVariableName,
      PsiVariable arrayVariable, PsiVariable indexVariable,
      PsiElement childToSkip, CommentTracker commentTracker, StringBuilder out) {
      if (element instanceof PsiExpression && isArrayLookup((PsiExpression)element, indexVariable, arrayVariable)) {
        out.append(contentVariableName);
      }
      else {
        final PsiElement[] children = element.getChildren();
        if (children.length == 0) {
          if (PsiUtil.isJavaToken(element, JavaTokenType.INSTANCEOF_KEYWORD) && out.charAt(out.length() - 1) != ' ') {
            out.append(' ');
          }
          out.append(commentTracker.text(element));
        }
        else {
          boolean skippingWhiteSpace = false;
          for (final PsiElement child : children) {
            if (child.equals(childToSkip)) {
              skippingWhiteSpace = true;
            }
            else if (child instanceof PsiWhiteSpace && skippingWhiteSpace) {
              //don't do anything
            }
            else {
              skippingWhiteSpace = false;
              replaceArrayAccess(child, contentVariableName, arrayVariable, indexVariable, childToSkip, commentTracker, out);
            }
          }
        }
      }
    }
private static void replaceArrayAccess(
      PsiElement element, String contentVariableName,
      PsiVariable arrayVariable, PsiVariable indexVariable,
      PsiElement childToSkip, CommentTracker commentTracker, StringBuilder out)