@Test
public void findJobsMergesAllCellsIntoSingleResult() {

    Random random = new Random();
    final List<Job> cellOneSnapshot = new ArrayList<>();
    final List<Job> cellTwoSnapshot = new ArrayList<>();
    for (int i = 0; i < 5; i++) {
        cellOneSnapshot.addAll(
                dataGenerator.newBatchJobs(random.nextInt(10), GrpcJobManagementModelConverters::toGrpcJob)
        );
        cellTwoSnapshot.addAll(
                dataGenerator.newBatchJobs(random.nextInt(10), GrpcJobManagementModelConverters::toGrpcJob)
        );
        cellOneSnapshot.addAll(
                dataGenerator.newServiceJobs(random.nextInt(10), GrpcJobManagementModelConverters::toGrpcJob)
        );
        cellTwoSnapshot.addAll(
                dataGenerator.newServiceJobs(random.nextInt(10), GrpcJobManagementModelConverters::toGrpcJob)
        );
        clock.advanceTime(1, TimeUnit.MINUTES);
    }
    cellOne.getServiceRegistry().addService(new CellWithFixedJobsService(cellOneSnapshot, cellOneUpdates.serialize()));
    cellTwo.getServiceRegistry().addService(new CellWithFixedJobsService(cellTwoSnapshot, cellTwoUpdates.serialize()));
    JobQuery query = JobQuery.newBuilder()
            .setPage(toGrpcPage(Page.unlimited()))
            .build();
    final AssertableSubscriber<JobQueryResult> testSubscriber = service.findJobs(query, UNDEFINED_CALL_METADATA).test();
    testSubscriber.awaitTerminalEvent(1, TimeUnit.SECONDS);
    testSubscriber.assertNoErrors().assertCompleted();
    testSubscriber.assertValueCount(1);
    final List<JobQueryResult> results = testSubscriber.getOnNextEvents();
    assertThat(results).hasSize(1);
    // expect stackName to have changed
    List<Job> expected = Stream.concat(cellOneSnapshot.stream(), cellTwoSnapshot.stream())
            .sorted(JobManagerCursors.jobCursorOrderComparator())
            .map(this::withStackName)
            .collect(Collectors.toList());
    assertThat(results.get(0).getItemsList()).containsExactlyElementsOf(expected);
}