### Question:
FeatureDescriptionFactory { public List<FeatureDescription> createDescriptions(NameMapper annotation) { List<FeatureDescription> descriptors = new ArrayList<>(); ExpectedFeature[] expectedFeatures = annotation.expectedFeatures(); if (expectedFeatures != null) { for (ExpectedFeature feature : expectedFeatures) { descriptors.add(createDescription(feature)); } } return descriptors; }  List<FeatureDescription> createDescriptions(NameMapper annotation);  }### Answer:
@Test public void should_create_descriptors() { ExpectedFeature doubleFeature = mock(ExpectedFeature.class); when(doubleFeature.name()).thenReturn("double"); when(doubleFeature.type()).thenReturn(DECIMAL); ExpectedFeature integerFeature = mock(ExpectedFeature.class); when(integerFeature.name()).thenReturn("integer"); when(integerFeature.type()).thenReturn(INTEGER); NameMapper inputStream = mock(NameMapper.class); when(inputStream.expectedFeatures()).thenReturn(new ExpectedFeature[] { doubleFeature, integerFeature }); List<FeatureDescription> descriptors = factory.createDescriptions(inputStream); assertThat(descriptors).containsOnly(new FeatureDescription("double", DECIMAL), new FeatureDescription("integer", INTEGER)); }