encoder.write(createKV(1));
encoder.write(createKV(0));
encoder.write(createKV(2));
InputStream is = new ByteArrayInputStream(bos.toByteArray());
Decoder decoder = codec.getDecoder(is);
decoder.advance();
KeyValue kv = (KeyValue) decoder.current();
List<Tag> tags = kv.getTags();
assertEquals(1, tags.size());
assertEquals("tagValue1", Bytes.toString(tags.get(0).getValue()));
decoder.advance();
kv = (KeyValue) decoder.current();
tags = kv.getTags();
assertEquals(0, tags.size());
decoder.advance();
kv = (KeyValue) decoder.current();
tags = kv.getTags();
assertEquals(2, tags.size());
assertEquals("tagValue1", Bytes.toString(tags.get(0).getValue()));
assertEquals("tagValue2", Bytes.toString(tags.get(1).getValue()));
}