@Test
public void removeType() throws InterruptedException {

    Tasks tasks = new Tasks();
    tasks.start(null);
    assertEquals(0, tasks.pending.size());
    TestTask testTask1 = new TestTask("id1");
    TestTask testTask2 = new TestTask("id2");
    tasks.add(testTask1);
    tasks.add(testTask2);
    assertEquals(2, tasks.pending.size());
    tasks.removeType(TestTask.taskType);
    assertEquals(1, tasks.pending.size());
    testTask1.wait = false;
    Thread.sleep(60);
    assertEquals(0, tasks.pending.size());
}