    @Test
    @Parameters
    public final void testAddToPending(final Short[][] referenceGroups) {

        for (Short[] referenceGroup : referenceGroups) {
            Segment segment = new Segment(++dataId, serializeShorts(referenceGroup));
            for (Short reference : referenceGroup) {
                handler.addToSent(reference, segment);
            }
        }

        int dataCount = 0;
        int referenceCount = 0;
        for (Short[] referenceGroup : referenceGroups) {
            dataCount++;
            referenceCount += referenceGroup.length;
        }
        assertEquals("Total data count match", dataCount,
                new HashSet<Segment>(handler.dataMap.getKeyMap().values()).size());
        assertEquals("Total reference count match", referenceCount, handler.dataMap.getKeyMap().keySet().size());


        for (Segment segment : handler.dataMap.getKeyMap().values()) {
            Short[] dataValues = deserializeShorts(segment.getData());
            assertEquals("Reference count match", dataValues.length, segment.getTransmissionIds().size());
            for (Short dataValue : dataValues) {
                assertTrue("Reference match", segment.getTransmissionIds().contains(dataValue));
            }
        }

    }