Package minpq

Class MinPQTests

    • Field Detail

      • toxic

        private final Map<Double,​String> toxic
        Associates toxicity value to comment because all toxicity values need to be unique.
    • Constructor Detail

      • MinPQTests

        public MinPQTests()
    • Method Detail

      • createMinPQ

        public abstract MinPQ<String> createMinPQ()
        Returns an empty MinPQ.
        Returns:
        an empty MinPQ
      • complicatedTest

        @Test
        void complicatedTest()
      • addAllComments

        private static void addAllComments​(MinPQ<String> pq,
                                           Map<Double,​String> toxic)
        Add all comments and toxicities to the given priority queue.
        Parameters:
        pq - destination priority queue.
        toxic - Map of toxicity values to comments (since comments can share the same toxicity value).
      • sameRemoveOrder

        private static boolean sameRemoveOrder​(MinPQ<String> ref,
                                               MinPQ<String> test)
        Remove all elements from ref and test and returns true if the order of removals are the same.
        Parameters:
        ref - the reference priority queue.
        test - the testing priority queue.
        Returns:
        true if the order of removals are the same.