### Question:
InitialParametersProvider { static SelectorFunction<Collection<Size>, Size> validPreviewSizeSelector(Size photoSize, SelectorFunction<Collection<Size>, Size> original) { return Selectors .firstAvailable( previewWithSameAspectRatio(photoSize, original), original ); } InitialParametersProvider(CapabilitiesOperator capabilitiesOperator,
                                     SelectorFunction<Collection<Size>, Size> photoSizeSelector,
                                     SelectorFunction<Collection<Size>, Size> previewSizeSelector,
                                     SelectorFunction<Collection<FocusMode>, FocusMode> focusModeSelector,
                                     SelectorFunction<Collection<Flash>, Flash> flashSelector,
                                     SelectorFunction<Collection<Range<Integer>>, Range<Integer>> previewFpsRangeSelector,
                                     SelectorFunction<Range<Integer>, Integer> sensorSensitivitySelector,
                                     Integer jpegQuality,
                                     InitialParametersValidator parametersValidator); Parameters initialParameters();  }### Answer:
@Test public void validPreviewSizeSelector_WithValidAspectRatio() throws Exception { Size result = InitialParametersProvider .validPreviewSizeSelector( PHOTO_SIZE, selectFromCollection(PREVIEW_SIZE) ) .select(ALL_PREVIEW_SIZES); assertEquals( PREVIEW_SIZE, result ); }
@Test public void validPreviewSizeSelector_NoPreviewSizeWithSameAspectRatio() throws Exception { Size photoSize = new Size(10000, 100); Size result = InitialParametersProvider .validPreviewSizeSelector( photoSize, selectFromCollection(PREVIEW_SIZE) ) .select(ALL_PREVIEW_SIZES); assertEquals( PREVIEW_SIZE, result ); }