@Override protected PriorityQueue<Long> ofAll(long[] array) { return PriorityQueue.ofAll(List.ofAll(array)); }
@Override protected PriorityQueue<Short> ofAll(short[] array) { return PriorityQueue.ofAll(List.ofAll(array)); }
@Override protected PriorityQueue<Float> ofAll(float[] array) { return PriorityQueue.ofAll(List.ofAll(array)); }
@Override protected PriorityQueue<Integer> ofAll(int[] array) { return PriorityQueue.ofAll(List.ofAll(array)); }
@Override protected PriorityQueue<Character> ofAll(char[] array) { return PriorityQueue.ofAll(List.ofAll(array)); }
@Override protected PriorityQueue<Double> ofAll(double[] array) { return PriorityQueue.ofAll(List.ofAll(array)); }
@Override protected PriorityQueue<Boolean> ofAll(boolean[] array) { return PriorityQueue.ofAll(List.ofAll(array)); }
@Override protected PriorityQueue<Byte> ofAll(byte[] array) { return PriorityQueue.ofAll(List.ofAll(array)); }
@Override protected <T> Traversable<T> ofJavaStream(Stream<? extends T> javaStream) { return PriorityQueue.ofAll(toStringComparator(), javaStream); }
@Override protected <T> PriorityQueue<T> ofAll(Iterable<? extends T> elements) { return PriorityQueue.ofAll(toStringComparator(), elements); }
@Override @SuppressWarnings("unchecked") protected final <T> PriorityQueue<T> of(T... elements) { return PriorityQueue.ofAll(toStringComparator(), List.of(elements)); }
@Override protected <T> PriorityQueue<T> of(T element) { return PriorityQueue.ofAll(toStringComparator(), List.of(element)); }
@Test public void toListIsSortedAccordingToComparator() { final Comparator<Integer> comparator = composedComparator(); final PriorityQueue<Integer> queue = PriorityQueue.ofAll(comparator, values); assertThat(queue.toList()).isEqualTo(values.sorted(comparator)); }