### Question:
FixedSizePriorityQueue { public FixedSizePriorityQueue(int maxSize, Comparator<? super E> comparator) { if (maxSize <= 0) { throw new IllegalArgumentException("maxSize = " + maxSize + "; expected a positive integer."); } Objects.requireNonNull(comparator, "comparator was null"); this.priorityQueue = new PriorityQueue<E>(maxSize, comparator); this.comparator = priorityQueue.comparator(); this.maxSize = maxSize; } FixedSizePriorityQueue(int maxSize, Comparator<? super E> comparator); void add(E e); List<E> asList();  }### Answer:
@Test public void testFixedSizePriorityQueue() { FixedSizePriorityQueue<Integer> fixedSizePriorityQueue = new FixedSizePriorityQueue<>(3, new Comparator<Integer>() { @Override public int compare(Integer o1, Integer o2) { return o1.compareTo(o2); } }); fixedSizePriorityQueue.add(1); fixedSizePriorityQueue.add(7); fixedSizePriorityQueue.add(2); fixedSizePriorityQueue.add(8); fixedSizePriorityQueue.add(0); fixedSizePriorityQueue.add(9); fixedSizePriorityQueue.add(4); fixedSizePriorityQueue.add(5); fixedSizePriorityQueue.add(3); fixedSizePriorityQueue.add(6); Assert.assertArrayEquals(new Integer[] { 7, 8, 9 }, fixedSizePriorityQueue.asList().toArray(new Integer[0])); }