@Test
public void shouldEncodeCorrectly() throws IOException, NullPointerException {
Charset charset = Charset.availableCharsets().get(BoundString.Encoding.ASCII);
ByteArrayOutputStream out = new ByteArrayOutputStream();
BitChannel channel = new OutputStreamBitChannel(out);
when(sizeExpr.eval(Matchers.any(Resolver.class))).thenReturn(4);
FixedLengthStringCodec codec =
new FixedLengthStringCodec(charset, sizeExpr, null, new BoundString.NullConverter());
codec.encode("Whatever", channel, resolver);
out.flush();