void (@Nullable Object element) { String message = "Wrong thread used for query structure, thread=" + Thread.currentThread() + " element=" + element; if (!myPassThroughMode) { if (isBgStructureBuilding()) { if (myForegroundLoadingNodes.contains(element)) { Assert.assertTrue(message, EventQueue.isDispatchThread()); } else { Assert.assertFalse(message, EventQueue.isDispatchThread()); } } else { Assert.assertTrue(message, EventQueue.isDispatchThread()); } } }