} catch(IllegalMonitorStateException ex) { throw ex;
    public Object peek() throws QueueClosedException {        Object retval=null;        synchronized(mutex) {            while(size == 0) {                if(closed)                    throw new QueueClosedException();                try {                    mutex.wait();                }                catch(IllegalMonitorStateException ex) {                    throw ex;                }                catch(InterruptedException ex) {                }            }            if(closed)                throw new QueueClosedException();            retval=(head != null)? head.obj : null;            // @remove:            if(retval == null) {                // print some diagnostics                if(log.isErrorEnabled()) log.error("retval is null: head=" + head + ", tail=" + tail + ", size()=" + size() +                                            ", num_markers=" + num_markers + ", closed()=" + closed());            }        }        if(retval == endMarker) {            close(false); // mark queue as closed            throw new QueueClosedException();        }        return retval;    }