void () { final boolean[] expired = new boolean[1]; final MyUpdate first = new MyUpdate("first") { @Override public boolean isExpired() { return expired[0]; } }; final MyUpdate second = new MyUpdate("second"); final MyQueue queue = new MyQueue(); queue.queue(first); queue.queue(second); assertFalse(first.isExecuted()); assertFalse(second.isExecuted()); expired[0] = true; queue.showNotify(); waitForExecution(queue); assertAfterProcessing(first, false, true); assertAfterProcessing(second, true, true); }