@Inject
    public PartialResultQueryManager()
    {
        this.queue = new PriorityBlockingQueue<>(1, comparing(PartialResultQueryTaskTracker::getMaxEndTime));
    }
@Test
    public void testPartialResultQueryManager()
            throws Exception
    {
        PartialResultQueryManager partialResultQueryManager = new PartialResultQueryManager();
        assertEquals(0, partialResultQueryManager.getQueueSize());

        PartialResultQueryTaskTracker tracker1 = new PartialResultQueryTaskTracker(partialResultQueryManager, 0.0, 2.0, warningCollector);
        PartialResultQueryTaskTracker tracker2 = new PartialResultQueryTaskTracker(partialResultQueryManager, 0.0, 2.0, warningCollector);

        // Assert that the trackers created above will have a default maxEndTime = 0. So current_time is always > tracker's maxEndTime.Meaning tracker is instantly ready for partial results.
        assertEquals(0, tracker1.getMaxEndTime());
        assertEquals(0, tracker2.getMaxEndTime());

        partialResultQueryManager.addQueryTaskTracker(tracker1);
        partialResultQueryManager.addQueryTaskTracker(tracker2);

        // Assert that the trackers are added to the queue
        assertEquals(2, partialResultQueryManager.getQueueSize());

        // Sleep for 2s so that we give enough time to partialResultQueryManager to wake up and clear the trackers in queue
        Thread.sleep(2000);

        // Assert the trackers are cleared
        assertEquals(0, partialResultQueryManager.getQueueSize());

        partialResultQueryManager.stop();
    }