test comparator and comparable