public List<Long> list(ListAllPOptions options) {
    try (JobMasterAuditContext auditContext =
             createAuditContext("list")) {
      List<Long> ids = new ArrayList<>();
      ids.addAll(mPlanTracker.findJobs(options.getName(),
          options.getStatusList().stream()
              .map(status -> Status.valueOf(status.name()))
              .collect(Collectors.toList())));
      ids.addAll(mWorkflowTracker.findJobs(options.getName(),
          options.getStatusList().stream()
              .map(status -> Status.valueOf(status.name()))
              .collect(Collectors.toList())));
      Collections.sort(ids);
      auditContext.setSucceeded(true);
      return ids;
    }
  }
@Test
  public void list() throws Exception {
    try (MockedStatic<PlanCoordinator> mockStaticPlanCoordinator = mockPlanCoordinator()) {
      TestPlanConfig jobConfig = new TestPlanConfig("/test");
      List<Long> jobIdList = new ArrayList<>();
      for (long i = 0; i < TEST_JOB_MASTER_JOB_CAPACITY; i++) {
        jobIdList.add(mJobMaster.run(jobConfig));
      }
      final List<Long> list = mJobMaster.list(ListAllPOptions.getDefaultInstance());
      Assert.assertEquals(jobIdList, list);
      Assert.assertEquals(TEST_JOB_MASTER_JOB_CAPACITY,
          mJobMaster.list(ListAllPOptions.getDefaultInstance()).size());
    }
  }