Functions { @SuppressWarnings("unchecked") @NonNull public static <T> Function<Throwable, Result<T>> failedResult() { return (Function<Throwable, Result<T>>) FAILED_RESULT; } private  Functions(); @NonNull static Function<F, T> staticFunction(@NonNull final T object); @NonNull static Function<F, T> supplierAsFunction(
      @NonNull final Supplier<? extends T> supplier); @NonNull static Function<T, T> identityFunction(); @NonNull @SuppressWarnings({"unchecked", "UnusedParameters"}) static FItem<F, F> functionFrom(@Nullable Class<F> from); @NonNull @SuppressWarnings({"unchecked", "UnusedParameters"}) static FList<F, List<F>, List<F>> functionFromListOf(
      @Nullable final Class<F> from); @SuppressWarnings("unchecked") @NonNull static Function<Throwable, Result<T>> failedResult(); @SuppressWarnings("unchecked") @NonNull static Function<Result<T>, List<T>> resultAsList(); @SuppressWarnings("unchecked") @NonNull static Function<T, List<T>> itemAsList(); @SuppressWarnings("unchecked") @NonNull static Function<Result<List<T>>, List<T>> resultListAsList();  }
@Test public void shouldWrapThrowableInFailedResult() { final Throwable throwable = new Throwable(); assertThat(failedResult().apply(throwable).getFailure(), is(throwable)); }