@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);
}