}
public void testSubResourceLocatorSorting()
{
AbstractResourceDescriptor resource = new AbstractResourceDescriptorImpl(SampleResource3.class);
SubResourceLocatorMap locs = resource.getSubResourceLocators();
Collection<UriPattern> uris = locs.keySet();
Iterator<UriPattern> i = uris.iterator();
// NOTE template will be normalized, first slash added
assertEquals("/b/c/d", i.next().getTemplate());
assertEquals("/b/c/z", i.next().getTemplate());
assertEquals("/b/c", i.next().getTemplate());
assertEquals("/b/{c}", i.next().getTemplate());
assertEquals("/b", i.next().getTemplate());
Iterator<SubResourceLocatorDescriptor> i2 = locs.values().iterator();
assertEquals("m3", i2.next().getMethod().getName());
assertEquals("m1", i2.next().getMethod().getName());
assertEquals("m4", i2.next().getMethod().getName());
assertEquals("m2", i2.next().getMethod().getName());
assertEquals("m0", i2.next().getMethod().getName());