@Test
public void testDecoding() throws DecodingException {

    SlicingCodec<String> codec = new SlicingCodec(wrapped, sizeExpr);
    when(sizeExpr.eval(resolver)).thenReturn(13);
    when(buffer.slice(Mockito.anyInt())).thenReturn(slice);
    when(wrapped.decode(any(BitBuffer.class), any(Resolver.class), any(Builder.class))).thenReturn("DONE");
    assertThat(codec.decode(buffer, resolver, builder), is("DONE"));
    verify(sizeExpr).eval(resolver);
    verify(buffer).slice(13);
    verify(wrapped).decode(slice, resolver, builder);
    verifyNoMoreInteractions(wrapped, sizeExpr, builder, buffer, slice, resolver);
}