class DelayedWorkQueue implements Delayed, Serializable {
    private static final long serialVersionUID = 1L;

    public String classKey;
    public long wakeTime;
    
    /**
     * Reference to the WorkQueue, perhaps saving a deserialization
     * from allQueues.
     */
    protected transient WorkQueue workQueue;
    
    public DelayedWorkQueue(WorkQueue queue) {
        this.classKey = queue.getClassKey();
        this.wakeTime = queue.getWakeTime();
        this.workQueue = queue;
    }
    
    // TODO: consider if this should be method on WorkQueueFrontier
    public WorkQueue getWorkQueue(WorkQueueFrontier wqf) {
        if (workQueue == null) {
            // This is a recently deserialized DelayedWorkQueue instance
            WorkQueue result = wqf.getQueueFor(classKey);
            this.workQueue = result;
        }
        return workQueue;
    }

    public long getDelay(TimeUnit unit) {
        return unit.convert(
                wakeTime - System.currentTimeMillis(),
                TimeUnit.MILLISECONDS);
    }
    
    public String getClassKey() {
        return classKey;
    }
    
    public long getWakeTime() {
        return wakeTime;
    }
    
    public void setWakeTime(long time) {
        this.wakeTime = time;
    }
    
    public int compareTo(Delayed obj) {<FILL_FUNCTION_BODY>}
    
}

        if (this == obj) {
            return 0; // for exact identity only
        }
        DelayedWorkQueue other = (DelayedWorkQueue) obj;
        if (wakeTime > other.getWakeTime()) {
            return 1;
        }
        if (wakeTime < other.getWakeTime()) {
            return -1;
        }
        // at this point, the ordering is arbitrary, but still
        // must be consistent/stable over time
        return this.classKey.compareTo(other.getClassKey());        
    
<no_super_class>