@Test
    public void simpleTest() throws Exception {
        final byte[] input = new byte[15];
        final byte[] zeroes = new byte[input.length];
        Arrays.fill(zeroes, (byte) 0);
        final int pipe_buf_size = 20;
        new Random().nextBytes(input);
        final Properties[] filter_configs = new Properties[]{
                new Properties(),
        };
        final ByteArrayOutputStream output = new ByteArrayOutputStream(input.length);

        filter_configs[0].setProperty("type", "Zero");

        final ConnectionProcessorPipe pipe = new ConnectionProcessorPipe(new ByteArrayInputStream(input),
									 new FilterFactory(filter_configs).getInstances(new MockConnectionProcessor()),
									 output,
									 new DevnullLogger(),
									 pipe_buf_size);
        pipe.run();
        print(input, "input");
        print(output.toByteArray(), "output");
        Assert.assertArrayEquals(zeroes, output.toByteArray());
        final Map<String, Long> stat = pipe.getStatistics();
        Assert.assertNull(pipe.getException());
        Assert.assertEquals(stat.get("exception_at").intValue(), 0);
        Assert.assertEquals(stat.get("bytes_in").intValue(), input.length);
        Assert.assertEquals(stat.get("bytes_out").intValue(), input.length);
        Assert.assertEquals(stat.get("read_count").intValue(), (pipe_buf_size / input.length) + 1); // one read results in -1
        Assert.assertEquals(stat.get("write_count").intValue(), pipe_buf_size / input.length);
        Assert.assertEquals(stat.size(), 9);
        Assert.assertTrue(stat.get("read_ms").intValue() < 100);
        Assert.assertTrue(stat.get("write_ms").longValue() < 100);
        Assert.assertTrue(stat.get("ended_at").longValue() - stat.get("began_at").longValue() < 1000);
    }