All the addMessage function is doing is, appending something to the
string builder.
I am not too sure what the source code would be like, but internally the append method would append each character of the string argument passed.
Since this method is not synchronized, 2 threads can be appending (perhaps adding characters in the for loop) at the same time.
So addMessage("abc") & addMessage("xyz") could append axbycz.
StringBuffer would always cause abc to be appended and only after that could xyz be appended or vice versa but never inter-mangle both.