@Test
    public void compareTo() {
        TestTask testTask1 = new TestTask();
        testTask1.setPriority(123);
        Assert.assertEquals(123, testTask1.getPriority());

        TestTask testTask2 = new TestTask();
        testTask2.setPriority(234);

        Assert.assertTrue(testTask1.compareTo(testTask2) > 0);

        PriorityQueue<AbstractTask> queue = new PriorityQueue<AbstractTask>();
        queue.offer(testTask1);
        queue.offer(testTask2);
        Assert.assertEquals(queue.poll(), testTask2);
        Assert.assertEquals(queue.poll(), testTask1);
    }
@author <a href="mailto:zhanggeng.zg@antfin.com">GengZhang</a>
core/api/src/test/java/com/alipay/sofa/rpc/server/AbstractTaskTest.java