final AdaptableResourceProviderImpl rp3 = new AdaptableResourceProviderImpl(new String[] {"/hello"}, 3L);
final ResourceProviderImpl rp4 = new ResourceProviderImpl(new String[] {"/you"}, 4L);
final SortedProviderList<Adaptable> spl = new SortedProviderList<Adaptable>(Adaptable.class);
check(spl, null);
spl.add(new ResourceProviderHandler(rp1, rp1.getProperties()));
check(spl, null);
spl.add(new ResourceProviderHandler(rp2, rp2.getProperties()));
check(spl, null, rp2);
spl.add(new ResourceProviderHandler(rp3, rp3.getProperties()));
check(spl, null, rp2, rp3);
spl.add(new ResourceProviderHandler(rp4, rp4.getProperties()));
check(spl, null, rp2, rp3);
spl.remove(new ResourceProviderHandler(rp1, rp1.getProperties()));
check(spl, null, rp2, rp3);
spl.remove(new ResourceProviderHandler(rp1, rp1.getProperties()));
check(spl, null, rp2, rp3);
spl.remove(new ResourceProviderHandler(rp4, rp4.getProperties()));
check(spl, null, rp2, rp3);
spl.remove(new ResourceProviderHandler(rp2, rp2.getProperties()));
check(spl, null, rp3);
spl.remove(new ResourceProviderHandler(rp3, rp3.getProperties()));
check(spl, null);
}