fail("illegal state should've been thrown on empty list");
}
public void testCompoundComparator() {
CompoundComparator c = new CompoundComparator();
c.addComparator(new PropertyComparator("lastName", false, true));
Dog dog1 = new Dog();
dog1.setFirstName("macy");
dog1.setLastName("grayspots");
Dog dog2 = new Dog();
dog2.setFirstName("biscuit");
dog2.setLastName("grayspots");
assertTrue(c.compare(dog1, dog2) == 0);
c.addComparator(new PropertyComparator("firstName", false, true));
assertTrue(c.compare(dog1, dog2) > 0);
dog2.setLastName("konikk dog");
assertTrue(c.compare(dog2, dog1) > 0);
}