void (String string, TextAttributes attrs) { synchronized (myLines) { myLines.add(new Line(string, attrs)); } if (myFlushAlarm.isEmpty()) { myFlushAlarm.addRequest(this::flushStoredLines, 200, ModalityState.nonModal()); } }