Its been quite a while for me, but if I remember correctly you need to use an interface for your class a and b and write a compare method.