initRepo();
final byte[] in1 = "1\n$Id:whatever".getBytes();
final byte[] in2 = " id doesn't close here\n3\n".getBytes();
ByteArrayChannel out = new ByteArrayChannel();
final Filter kwFilter = createFilter(Filter.Direction.ToRepo);
out.write(kwFilter.filter(ByteBuffer.wrap(in1)));
out.write(kwFilter.filter(ByteBuffer.wrap(in2)));
byte[] expected = new byte[in1.length + in2.length];
System.arraycopy(in1, 0, expected, 0, in1.length);
System.arraycopy(in2, 0, expected, in1.length, in2.length);
Assert.assertEquals(new String(expected), new String(out.toArray()));