private static void escapeLastSymbols(StringBuilder builder, char toEscape) {
    for (int i = builder.length() - 1; i >= 0 && builder.charAt(i) == toEscape; i--) {
      builder.insert(i, '\\');
    }
  }
private static void escapeLastSymbols(StringBuilder builder, char toEscape)