docs: private void grow(int newCapacity) {
      List<E> newElements = new ArrayList<E>(newCapacity);
      double[] newPriorities = new double[newCapacity];
      if (size > 0) {
        newElements.addAll(elements);
        System.arraycopy(priorities, 0, newPriorities, 0, priorities.length);
      }
      elements = newElements;
      priorities = newPriorities;
      capacity = newCapacity;
    }