@Test
public void shouldWorkWithZeroSizeList() throws DecodingException {

    when(listCodec.decode(any(BitBuffer.class), any(Resolver.class), any(Builder.class)))
            .thenReturn(Collections.<Map.Entry<String, Integer>>emptyList());
    ListBasedMapCodec<String,Integer> codec = new ListBasedMapCodec<String, Integer>(listCodec);
    Map<String, Integer> map = codec.decode(buffer, resolver, builder);
    assertThat(map.size(), is(0));
    verify(listCodec).decode(buffer, resolver, builder);
    Mockito.verifyNoMoreInteractions(listCodec);
}