### Question:
FeatureService { public List<FeatureDTO> listAll() { return this.featureCollection.list().stream() .map(feature -> new FeatureDTO(feature.getCode(), this.featureActivator.getState(feature.getCode()))) .collect(Collectors.toList()); }  List<FeatureDTO> listAll(); DetailledFeatureDTO find(String code); FeatureDTO findDefaultOf(String code); List<FeatureDTO> retrieveStateOf(List<String> codes); void update(List<FeatureDTO> featuresToUpdate); void reset(List<String> featuresToReset); boolean isEnabled(String featureCode);  }### Answer:
@Test public void listAll_should_return_the_list_of_features() { String feature1Code = "feature-1"; String feature2Code = "my-feature"; List<IFeature> features = new ArrayList<>(); IFeature mockFeature1 = given_a_feature(feature1Code, "Desc 1", "Feature 1"); IFeature mockFeature2 = given_a_feature(feature2Code, "Desc 2", "Feature 2"); features.add(mockFeature1); features.add(mockFeature2); Mockito.doReturn(features).when(featureCollectionMock).list(); Mockito.doReturn(false).when(featureActivatorMock).getState(feature1Code); Mockito.doReturn(true).when(featureActivatorMock).getState(feature2Code); List<FeatureDTO> featuresDTO = cut.listAll(); Assertions.assertThat(featuresDTO).hasSize(features.size()); Assertions.assertThat(featuresDTO.get(0)).isNotNull(); Assertions.assertThat(featuresDTO.get(0)).isEqualTo(new FeatureDTO(feature1Code, false)); Assertions.assertThat(featuresDTO.get(1)).isEqualTo(new FeatureDTO(feature2Code, true)); }