code: private Queue<PoolSchedulable> createPoolQueue(
        ScheduleComparator comparator) {
      int initCapacity =
          snapshotPools.size() == 0 ? 1 : snapshotPools.size();
      Queue<PoolSchedulable> poolQueue =
          new PriorityQueue<PoolSchedulable>(initCapacity, comparator);
      poolQueue.addAll(snapshotPools);
      return poolQueue;
    }
docs: Put all the pools into the priority queue sorted by a comparator
  @param comparator the comparator to sort all the pools in the queue by
  @return the queue of the pools sorted by a comparator