### Question:
Selectors { public static <T> SelectorFunction<Collection<T>, T> single(final T preference) { return new SelectorFunction<Collection<T>, T>() { @Override public T select(Collection<T> items) { return items.contains(preference) ? preference : null; } }; }  @SafeVarargs static SelectorFunction<Input, Output> firstAvailable(@NonNull final SelectorFunction<Input, Output> function,
                                                         final SelectorFunction<Input, Output>... functions); static SelectorFunction<Collection<T>, T> filtered(@NonNull final SelectorFunction<Collection<T>, T> selector,
                                                   @NonNull final Predicate<T> predicate); static SelectorFunction<Collection<T>, T> single(final T preference); static SelectorFunction<Input, Output> nothing();  }### Answer:
@Test public void single() throws Exception { String result = Selectors .single("b") .select(asList( "a", "b", "c" )); assertEquals("b", result); }
@Test public void single_NotFound() throws Exception { String result = Selectors .single("b") .select(asList( "a", "c" )); assertEquals(null, result); }