@Test
public void sortsResourceMethodsByConsumesAndProducesTypes() {

    ResourceDescriptor resource = new AbstractResourceDescriptor(ResourceForTestSortingOfResourceMethods.class);
    List<String> methodNames = resource.getResourceMethods().get("GET").stream().map(resourceMethod -> resourceMethod.getMethod().getName()).collect(toList());
    assertEquals(newArrayList("first", "second", "third", "fourth", "fifth", "last"), methodNames);
}