code: private Queue<PoolGroupSchedulable> createPoolGroupQueue(
        ScheduleComparator comparator) {
      int initCapacity =
          snapshotPoolGroups.size() == 0 ? 1 : snapshotPoolGroups.size();
      Queue<PoolGroupSchedulable> poolGroupQueue =
          new PriorityQueue<PoolGroupSchedulable>(initCapacity, comparator);
      poolGroupQueue.addAll(snapshotPoolGroups);
      return poolGroupQueue;
    }
docs: Put all the pool groups into the priority queue sorted by a comparator
  @param comparator the comparator to sort all the pool groups in the queue
  @return the queue of the pool groups sorted by a comparator