void () { Application application = ApplicationManager.getApplication(); if (application == null) { // skipping write access check in simple tests assertEventQueueDispatchThread(); } else { assert !application.isWriteAccessAllowed() : "do not wait under write action to avoid possible deadlock"; ThreadingAssertions.assertEventDispatchThread(); } }