assertEquals(LIVE, ((ResourceSearchResultItem) result.getItems()[0]).getResourceURI().getVersion());
assertEquals(WORK, ((ResourceSearchResultItem) result.getItems()[1]).getResourceURI().getVersion());
assertEquals(LIVE, ((ResourceSearchResultItem) result.getItems()[2]).getResourceURI().getVersion());
// Lock the page, which will trigger a call to index.update()
repository.lock(liveAndWorkWorkURI, new UserImpl("user"));
assertEquals(2, repository.find(workOnlyQuery).getDocumentCount());
assertEquals(2, repository.find(liveOnlyQuery).getDocumentCount());
result = repository.find(workPreferredQuery);
assertEquals(3, result.getDocumentCount());
assertEquals(LIVE, ((ResourceSearchResultItem) result.getItems()[0]).getResourceURI().getVersion());