ActionCallback () { myRestoringNow = true; if (myActions.size() == 0) return ActionCallback.DONE; final ActionCallback topCallback = restore(0); return topCallback.doWhenDone(() -> { myActions.clear(); myRestoringNow = false; }); }