### Question:
FlashSelectors { public static SelectorFunction<Collection<Flash>, Flash> autoRedEye() { return flash(Flash.AUTO_RED_EYE); }  static SelectorFunction<Collection<Flash>, Flash> off(); static SelectorFunction<Collection<Flash>, Flash> on(); static SelectorFunction<Collection<Flash>, Flash> autoFlash(); static SelectorFunction<Collection<Flash>, Flash> autoRedEye(); static SelectorFunction<Collection<Flash>, Flash> torch();  }### Answer:
@Test public void focusMode_Available() throws Exception { Set<Flash> availableModes = asSet( Flash.AUTO, Flash.AUTO_RED_EYE, Flash.OFF ); Flash result = FlashSelectors .autoRedEye() .select(availableModes); assertEquals( Flash.AUTO_RED_EYE, result ); }
@Test public void focusMode_NotAvailable() throws Exception { Set<Flash> availableModes = asSet( Flash.AUTO, Flash.OFF ); Flash result = FlashSelectors .autoRedEye() .select(availableModes); assertNull(result); }