}
@Test
public void compareTo_resourceFunctions_most_specific_path_first() {
final PathAnnotation mockPathAnnotation = mock(PathAnnotation.class);
final ResourceFunction mockResourceFunction = mock(ResourceFunction.class);
final RestXqServiceMock restXqService = new RestXqServiceMock(mockResourceFunction);
final PathAnnotation otherMockPathAnnotation = mock(PathAnnotation.class);
final ResourceFunction otherMockResourceFunction = mock(ResourceFunction.class);
final RestXqServiceMock otherRestXqService = new RestXqServiceMock(otherMockResourceFunction);
when(mockResourceFunction.getPathAnnotation()).thenReturn(mockPathAnnotation);
when(mockPathAnnotation.getPathSpecificityMetric()).thenReturn(Long.valueOf(3));
when(otherMockResourceFunction.getPathAnnotation()).thenReturn(otherMockPathAnnotation);
when(otherMockPathAnnotation.getPathSpecificityMetric()).thenReturn(Long.valueOf(2));
final int result = restXqService.compareTo(otherRestXqService);
assertEquals(-1, result);
}