public boolean produce(T data) {
        if (driver != null) {
            if (!driver.isRunning(channels)) {
                return false;
            }
        }

        return this.channels.save(data);
    }
@Test
    public void testProduce() throws IllegalAccessException {
        DataCarrier<SampleData> carrier = new DataCarrier<>(2, 100);
        assertTrue(carrier.produce(new SampleData().setName("a")));
        assertTrue(carrier.produce(new SampleData().setName("b")));
        assertTrue(carrier.produce(new SampleData().setName("c")));
        assertTrue(carrier.produce(new SampleData().setName("d")));

        Channels<SampleData> channels = Whitebox.getInternalState(carrier, "channels");
        QueueBuffer<SampleData> buffer1 = channels.getBuffer(0);

        List result = new ArrayList();
        buffer1.obtain(result);
        assertEquals(2, result.size());

        QueueBuffer<SampleData> buffer2 = channels.getBuffer(1);
        buffer2.obtain(result);

        assertEquals(4, result.size());

    }