public synchronized boolean remove(Object listener) {
        if (listener == null) {
            //TODO add a log message to help developers know they are 
            //probably doing something wrong
            return false;
        }
        
        //most of the time there will a single listener 
        //check first for that to speed up   
        if (listenerArray.length == 1) {
            if (listenerArray[0].equals(listener)) {
                listenerArray = NULL_ARRAY;
            }
            return true;
        }
        
        // Is listener on the list?
        int index = -1;
        for (int i = listenerArray.length; i!=0;) {
            if (listenerArray[--i].equals(listener)) {
                index = i;
                break;
            }
        }
        // If so,  remove it
        if (index != -1) {
            Object[] tmp = new Object[listenerArray.length-1];
            // Copy the list up to index
            System.arraycopy(listenerArray, 0, tmp, 0, index);
            // Copy from past the index, up to
            // the end of tmp (which is one element
            // shorter than the old list)
            if (index < tmp.length) {
                System.arraycopy(listenerArray, index+1, tmp, index, 
                        tmp.length - index);
            }
            // set the listener array
            listenerArray = tmp;
            return true;
        } else {
            return false;
        }
    }