OutputListener may be called from multiple threads (if a test spaws more threads), but StringBuilder is not thread-safe. In this case, using the old StringBuffer is preferred. Additionally, for full thread-safety, getOutAndReset() should synchronize on the StringBuilder instance.