@Test
public void testMergeQueryResultsInDescOrder() {

    ServiceDocumentQueryResult result1 = createServiceDocumentQueryResult(
            new int[] { 9, 7, 5, 4, 3, 1 });
    ServiceDocumentQueryResult result2 = createServiceDocumentQueryResult(
            new int[] { 9, 6, 5, 4, 3, 2, 10 });
    ServiceDocumentQueryResult result3 = createServiceDocumentQueryResult(
            new int[] { 8, 4, 3, 2, 10, 1 });
    List<ServiceDocumentQueryResult> resultsToMerge = Arrays.asList(result1, result2, result3);
    ServiceDocumentQueryResult mergeResult = new ServiceDocumentQueryResult();
    QueryTaskUtils.mergeQueryResults(resultsToMerge, false, mergeResult);
    assertTrue(verifyMergeResult(mergeResult, new int[] { 9, 8, 7, 6, 5, 4, 3, 2, 10, 1 }));
}