QueryController { int skipToLast(int cursorLength, int limit) { if (cursorLength > limit) { return cursorLength - limit; } return 0; }  @Secured(Roles.ROLE_ADMIN) @RequestMapping(value = "/{collection}/{id}", method = RequestMethod.DELETE) ResponseEntity<?> deleteDocument(@PathVariable("collection") String collection,
        @PathVariable("id") String id); @RequestMapping(value = "/{collection}/{id}", method = RequestMethod.GET) ResponseEntity<String> find(
        @PathVariable("collection") String collection,
        @PathVariable("id") String id); @RequestMapping(value = "/{collection}/", method = RequestMethod.GET) @ResponseBody ResponseEntity<String> find(
        @PathVariable("collection") String collection,
        @RequestParam(value = "version", required = false) String version,
        @RequestParam(value = "category", required = false) String category,
        @RequestParam(value = "limit", required = false) String limit,
        @RequestParam(value = "skip", required = false) String skip,
        @RequestParam(value = "sort", required = false) String sort,
        @RequestParam(value = "last", required = false) String last);  }
@Test(dataProvider = "computeNumberOfSkips") public void last_ten_with_list_nine(int cursorLength, int lastNrOfDocuments, int expectedNrOfSkips) { QueryController queryController = new QueryController(); int actualNrOfSkips = queryController.skipToLast(cursorLength, lastNrOfDocuments); assertEquals(actualNrOfSkips, expectedNrOfSkips); }