### Question:
PreviewFpsRangeSelectors { public static SelectorFunction<Collection<Range<Integer>>, Range<Integer>> fromExactFps(int fps) { return filtered(rangeWithHighestFps(), new ExactFpsRangePredicate(fps * FPS_RANGE_BOUNDS_SCALE)); }  static SelectorFunction<Collection<Range<Integer>>, Range<Integer>> fromExactFps(int fps); static SelectorFunction<Collection<Range<Integer>>, Range<Integer>> nearestToExactFps(int fps); static SelectorFunction<Collection<Range<Integer>>, Range<Integer>> rangeWithHighestFps(); static SelectorFunction<Collection<Range<Integer>>, Range<Integer>> rangeWithLowestFps();  }### Answer:
@Test public void fromExactFps_Available() throws Exception { List<Range<Integer>> availableRanges = Arrays.<Range<Integer>>asList( Ranges.continuousRange(24000, 24000), Ranges.continuousRange(30000, 30000), Ranges.continuousRange(40000, 40000) ); Range<Integer> result = PreviewFpsRangeSelectors .fromExactFps(30) .select(availableRanges); assertEquals( Ranges.continuousRange(30000, 30000), result ); }
@Test public void fromExactFps_NotAvailable() throws Exception { List<Range<Integer>> availableRanges = Arrays.<Range<Integer>>asList( Ranges.continuousRange(24000, 30000), Ranges.continuousRange(30000, 36000), Ranges.continuousRange(40000, 40000) ); Range<Integer> result = PreviewFpsRangeSelectors .fromExactFps(30) .select(availableRanges); assertNull(result); }