* monitor of the PrintStream first, before all other locks.
*/
@Test
public void does_not_deadlock_if_somebody_locks_in_the_PrintStream_externally() throws Exception {
final int ITERATIONS = 10;
PrintStream printStream = SynchronizedPrintStream.create(new NullOutputStream(), Charset.defaultCharset(), lock);
// will fail with a test timeout if a deadlock happens
runConcurrently(() -> {
// what Thread.printStackTrace() would do
synchronized (printStream) {