void () { int N = 100000; PlatformTestUtil.startPerformanceTest("Event queue dispatch", 10000, () -> { UIUtil.dispatchAllInvocationEvents(); AtomicInteger count = new AtomicInteger(); for (int i = 0; i < N; i++) { SwingUtilities.invokeLater(count::incrementAndGet); } UIUtil.dispatchAllInvocationEvents(); assertEquals(N, count.get()); }).assertTiming(); }