ActionCallback () { if (myCallbacks.isEmpty()) { return DONE; } ActionCallback result = new ActionCallback(myCallbacks.size()); Runnable setDoneRunnable = result.createSetDoneRunnable(); for (ActionCallback each : myCallbacks) { each.doWhenProcessed(setDoneRunnable); } return result; }