@Test
public void shouldWorkWithNormalList() throws DecodingException {

    when(listCodec.decode(any(BitBuffer.class), any(Resolver.class), any(Builder.class)))
            .thenReturn(Arrays.asList(item1, item2));
    when(item1.getKey()).thenReturn("foo");
    when(item1.getValue()).thenReturn(1);
    when(item2.getKey()).thenReturn("bar");
    when(item2.getValue()).thenReturn(2);
    ListBasedMapCodec<String,Integer> codec = new ListBasedMapCodec<String, Integer>(listCodec);
    Map<String, Integer> map = codec.decode(buffer, resolver, builder);
    assertThat(map.size(), is(2));
    assertThat(map, hasEntry("foo", 1));
    assertThat(map, hasEntry("bar", 2));
    verify(listCodec).decode(buffer, resolver, builder);
    Mockito.verifyNoMoreInteractions(listCodec);        
}