StringBuilder instead of StringBuffer.
notifyNewMessages -> notifyNodes.