private Entry<K,V> getEntry(Object key) {
        Entry<K,V> p = root;
	K k = (K) key;
        while (p != null) {
            int cmp = compare(k, p.key);
            if (cmp == 0)
                return p;
            else if (cmp < 0)
                p = p.left;
            else
                p = p.right;
        }
        return null;
    }