void () { if (!myTransactionStarted) return; myTransactionStarted = false; super.endTransaction(); Collections.sort(myWords); // to ensure stable ordering builder.append('['); boolean bar = false; for (String word : myWords) { if (bar) builder.append('|'); else bar = true; builder.append(word); } this.builder.append(']'); myWords.clear(); }