code: public Queue<SessionSchedulable> createSessionQueue(
        ScheduleComparator comparator) {
      int initCapacity = snapshotSessions.size() == 0 ?
          1 : snapshotSessions.size();
      Queue<SessionSchedulable> sessionQueue =
        new PriorityQueue<SessionSchedulable>(initCapacity, comparator);
      sessionQueue.addAll(snapshotSessions);
      return sessionQueue;
    }
docs: Get the queue of sessions in the pool sorted by comparator
  @param comparator the comparator to use when sorting sessions
  @return the queue of the sessions sorted by a given comparator