public void testRequiredLayoutTriggeredWhilePerformingLayoutStillGetsRegistered() throws Exception { for (int i = 0; i < 100; i++) panel.add(new PropPanel(new MockProp())); panel.markAsNeedingLayout(); Thread thread = new Thread( new Runnable() { public void run() { panel.doLayout(); } }); thread.start(); while (panel.getChildren().get(0).needsLayout()) Thread.yield(); panel.markAsNeedingLayout(); thread.join(); assertEquals(true, panel.needsLayout()); }