class DelayedTaskQueue {

    public boolean remove(DelayedTask task) {
        boolean wasRemoved = false;
        Iterator<Entry> iterator = tasks.iterator();
        while (iterator.hasNext()) {
            Entry entry = iterator.next();
            if (entry.task.equals(task)) {
                iterator.remove();
                wasRemoved = true;
            }
        }
        return wasRemoved;
    }

    public  DelayedTaskQueue();

}