Opt-in via Comparable seems rather risky to me.It's not just potential divergence between equals() and compareTo(), which the Comparable specification explicitly allows. At the very least, you'd have to add totally separate balanced trees for each class of key objects.
-- Florian Weimer / Red Hat Product Security Team