void () { DefaultMutableTreeNode[] nodes = myPendingNodeActions.toArray(new DefaultMutableTreeNode[0]); myPendingNodeActions.clear(); for (DefaultMutableTreeNode each : nodes) { processNodeActionsIfReady(each); } Runnable[] actions = myYieldingDoneRunnables.toArray(ArrayUtil.EMPTY_RUNNABLE_ARRAY); for (Runnable each : actions) { if (!isYieldingNow()) { myYieldingDoneRunnables.remove(each); each.run(); } } maybeReady(); }