### Question:
AspectRatioSelectors { public static SelectorFunction<Collection<Size>, Size> wideRatio(SelectorFunction<Collection<Size>, Size> selector) { return aspectRatio(16f / 9f, selector); }  static SelectorFunction<Collection<Size>, Size> standardRatio(SelectorFunction<Collection<Size>, Size> selector); static SelectorFunction<Collection<Size>, Size> standardRatio(SelectorFunction<Collection<Size>, Size> selector, double tolerance); static SelectorFunction<Collection<Size>, Size> wideRatio(SelectorFunction<Collection<Size>, Size> selector); static SelectorFunction<Collection<Size>, Size> wideRatio(SelectorFunction<Collection<Size>, Size> selector, double tolerance); static SelectorFunction<Collection<Size>, Size> aspectRatio(float aspectRatio, SelectorFunction<Collection<Size>, Size> selector, double tolerance); static SelectorFunction<Collection<Size>, Size> aspectRatio(float aspectRatio,
                                                     SelectorFunction<Collection<Size>, Size> selector);  }### Answer:
@Test public void wideRatio() throws Exception { given(sizeSelector.select(ArgumentMatchers.<Size>anyCollection())) .willReturn(new Size(16, 9)); Size result = AspectRatioSelectors .wideRatio(sizeSelector) .select(asList( new Size(16, 9), new Size(32, 18), new Size(10, 10) )); assertEquals( new Size(16, 9), result ); verify(sizeSelector).select(asSet( new Size(16, 9), new Size(32, 18) )); }
@Test public void wideRatioWithTolerance() throws Exception { given(sizeSelector.select(ArgumentMatchers.<Size>anyCollection())) .willReturn(new Size(16, 9)); Size result = AspectRatioSelectors .wideRatio(sizeSelector, 0.1) .select(asList( new Size(16, 9), new Size(16, 10), new Size(32, 18), new Size(32, 20), new Size(10, 10) )); assertEquals( new Size(16, 9), result ); verify(sizeSelector).select(asSet( new Size(16, 9), new Size(16, 10), new Size(32, 18), new Size(32, 20) )); }