public Set<Long> findCmdIds(List<Status> statusList) throws JobDoesNotExistException {
    Set<Long> set = new HashSet<>();
    for (Map.Entry<Long, CmdInfo> x : mInfoMap.entrySet()) {
      if (statusList.isEmpty()
              || statusList.contains(getCmdStatus(
                      x.getValue().getJobControlId()))) {
        Long key = x.getKey();
        set.add(key);
      }
    }
    return set;
  }
@Test
  public void testFindCmdIdsForComplete() throws Exception {
    long completedId = generateMigrateCommandForStatus(Status.COMPLETED);
    mSearchingCriteria.add(Status.COMPLETED);
    Set<Long> completedCmdIds = mCmdJobTracker.findCmdIds(mSearchingCriteria);
    Assert.assertEquals(completedCmdIds.size(), 1);
    Assert.assertTrue(completedCmdIds.contains(completedId));
  }