test_class.declarator: annotations
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private AnnotatedElement annotations;
test_class.type: AnnotatedElement
test_class.var_name: annotations
test_class.declarator: boundList
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private BoundList boundList;
test_class.type: BoundList
test_class.var_name: boundList
test_class.declarator: delegate
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private CodecFactory delegate;
test_class.type: CodecFactory
test_class.var_name: delegate
test_class.declarator: codec
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private Codec<List> codec;
test_class.type: Codec<List>
test_class.var_name: codec
test_class.declarator: context
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ResolverContext context;
test_class.type: ResolverContext
test_class.var_name: context
test_class.declarator: choices
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private Choices choices;
test_class.type: Choices
test_class.var_name: choices
test_class.declarator: firstChoice
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private Choices.Choice firstChoice;
test_class.type: Choices.Choice
test_class.var_name: firstChoice
test_class.declarator: secondChoice
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private Choices.Choice secondChoice;
test_class.type: Choices.Choice
test_class.var_name: secondChoice
test_class.file: preon-binding/src/test/java/org/codehaus/preon/codec/MapCodecFactoryTest.java
test_class.identifier: MapCodecFactoryTest
test_case.body: @Test
      public void shouldReturnCodecForObjectAnnotatedWithChoices() {
          when(annotations.getAnnotation(BoundList.class)).thenReturn(boundList);
          when(delegate.create(annotations, List.class, context)).thenReturn(codec);
          when(boundList.selectFrom()).thenReturn(choices);
          when(choices.alternatives()).thenReturn(new Choices.Choice[] { firstChoice, secondChoice });
          when(firstChoice.type()).thenReturn((Class) Map.Entry.class);
          when(secondChoice.type()).thenReturn((Class) Map.Entry.class);
  
          MapCodecFactory factory = new MapCodecFactory(delegate);
          Codec<Map> mapCodec = factory.create(annotations, Map.class, context);
          assertThat(mapCodec, is(not(nullValue())));
  
          verify(delegate).create(annotations, List.class, context);
          verify(annotations).getAnnotation(BoundList.class);
          verifyNoMoreInteractions(annotations, delegate, codec);
      }
test_case.class_method_signature: MapCodecFactoryTest.shouldReturnCodecForObjectAnnotatedWithChoices()
test_case.full_signature: @Test public void shouldReturnCodecForObjectAnnotatedWithChoices()
test_case.identifier: shouldReturnCodecForObjectAnnotatedWithChoices
test_case.invocations: thenReturn when getAnnotation thenReturn when create thenReturn when selectFrom thenReturn when alternatives thenReturn when type thenReturn when type create assertThat is not nullValue create verify getAnnotation verify verifyNoMoreInteractions
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldReturnCodecForObjectAnnotatedWithChoices()
focal_class.declarator: codecFactory
focal_class.modifier: private final
focal_class.original_string: private final CodecFactory codecFactory;
focal_class.type: CodecFactory
focal_class.var_name: codecFactory
focal_class.file: preon-binding/src/main/java/org/codehaus/preon/codec/MapCodecFactory.java
focal_class.identifier: MapCodecFactory
focal_class.interfaces: implements CodecFactory
focal_class.class_method_signature: MapCodecFactory.MapCodecFactory(CodecFactory codecFactory)
focal_class.full_signature: public  MapCodecFactory(CodecFactory codecFactory)
focal_class.identifier: MapCodecFactory
focal_class.modifiers: public
focal_class.parameters: (CodecFactory codecFactory)
focal_class.signature:  MapCodecFactory(CodecFactory codecFactory)
focal_class.class_method_signature: MapCodecFactory.create(AnnotatedElement metadata, Class<T> type, ResolverContext context)
focal_class.full_signature: public Codec<T> create(AnnotatedElement metadata, Class<T> type, ResolverContext context)
focal_class.identifier: create
focal_class.modifiers: public
focal_class.parameters: (AnnotatedElement metadata, Class<T> type, ResolverContext context)
focal_class.return: Codec<T>
focal_class.signature: Codec<T> create(AnnotatedElement metadata, Class<T> type, ResolverContext context)
focal_class.class_method_signature: MapCodecFactory.typeIsGuaranteedToBeEntry(BoundList boundList)
focal_class.full_signature: private boolean typeIsGuaranteedToBeEntry(BoundList boundList)
focal_class.identifier: typeIsGuaranteedToBeEntry
focal_class.modifiers: private
focal_class.parameters: (BoundList boundList)
focal_class.return: boolean
focal_class.signature: boolean typeIsGuaranteedToBeEntry(BoundList boundList)
focal_method.body: public <T> Codec<T> create(AnnotatedElement metadata, Class<T> type, ResolverContext context) {
          if (Map.class.isAssignableFrom(type)) {
              BoundList boundList = metadata.getAnnotation(BoundList.class);
              if (boundList != null && typeIsGuaranteedToBeEntry(boundList)) {
                  Codec<List> listCodec =
                          codecFactory.create(metadata, List.class, context);
                  if (listCodec != null) {
                      return new ListBasedMapCodec(listCodec);
                  }  else {
                      return null;
                  }
              }
          }
          return null;
      }
focal_method.class_method_signature: MapCodecFactory.create(AnnotatedElement metadata, Class<T> type, ResolverContext context)
focal_method.full_signature: public Codec<T> create(AnnotatedElement metadata, Class<T> type, ResolverContext context)
focal_method.identifier: create
focal_method.invocations: isAssignableFrom getAnnotation typeIsGuaranteedToBeEntry create
focal_method.modifiers: public
focal_method.parameters: (AnnotatedElement metadata, Class<T> type, ResolverContext context)
focal_method.return: Codec<T>
focal_method.signature: Codec<T> create(AnnotatedElement metadata, Class<T> type, ResolverContext context)