@Override
    public void addProcessor(PacketProcessor processor, int priority) {
        ProcessorEntry entry = new ProcessorEntry(processor, priority);

        // Insert the new processor according to its priority.
        int i = 0;
        for (; i < processors.size(); i++) {
            if (priority < processors.get(i).priority()) {
                break;
            }
        }
        processors.add(i, entry);
    }
@Test
    public void addProcessorTest() {
        PacketProcessor testProcessor = new TestProcessor();
        packetManager1.addProcessor(testProcessor, PROCESSOR_PRIORITY);

        assertEquals("1 processor expected", 1,
                    packetManager1.getProcessors().size());
        assertEquals("0 processor expected", 0,
                     packetManager2.getProcessors().size());

        assertEquals("not equal packet processor", testProcessor,
                     packetManager1.getProcessors().get(0).processor());
        assertEquals("not equal packet processor priority", PROCESSOR_PRIORITY,
                     packetManager1.getProcessors().get(0).priority());
    }