void (@NotNull DocumentEx document) { document.addDocumentListener(myDocumentMulticaster.getMulticaster()); document.addDocumentListener(new DocumentListener() { @Override public void beforeDocumentChange(@NotNull DocumentEvent event) { DOCUMENT_EP.forEachExtensionSafe(it -> it.beforeDocumentChange(event)); } @Override public void documentChanged(@NotNull DocumentEvent event) { DOCUMENT_EP.forEachExtensionSafe(it -> it.documentChanged(event)); } @Override public void bulkUpdateStarting(@NotNull Document document) { DOCUMENT_EP.forEachExtensionSafe(it -> it.bulkUpdateStarting(document)); } @Override public void bulkUpdateFinished(@NotNull Document document) { DOCUMENT_EP.forEachExtensionSafe(it -> it.bulkUpdateFinished(document)); } }); document.addDocumentListener(myPrioritizedDocumentMulticaster.getMulticaster()); document.addEditReadOnlyListener(myEditReadOnlyMulticaster.getMulticaster()); }