boolean contains=msgs.containsKey(key);
    public Message remove() {        Message retval;        synchronized(msgs) {            Long key=new Long(next_to_remove);            boolean contains=msgs.containsKey(key); // todo: remove containsKey() once this is debugged            retval=(Message)msgs.remove(key);            if(retval != null)                next_to_remove++;            else {                if(contains) {                    log.warn("seqno " + key + " has a null Message associated with it");                }            }        }        return retval;    }