@Test public void shouldChainSupplierAndResultHandler() { Supplier<String> supplier = () -> "BLA"; Supplier<String> supplierWithRecovery = SupplierUtils.andThen(supplier, result -> "Bla"); String result = supplierWithRecovery.get(); assertThat(result).isEqualTo("Bla"); }
public static <T, R> Supplier<R> andThen(Supplier<T> supplier, Function<T, R> resultHandler) { return () -> resultHandler.apply(supplier.get()); }
SupplierUtils { public static <T, R> Supplier<R> andThen(Supplier<T> supplier, Function<T, R> resultHandler) { return () -> resultHandler.apply(supplier.get()); } }
SupplierUtils { public static <T, R> Supplier<R> andThen(Supplier<T> supplier, Function<T, R> resultHandler) { return () -> resultHandler.apply(supplier.get()); } private  SupplierUtils(); }
SupplierUtils { public static <T, R> Supplier<R> andThen(Supplier<T> supplier, Function<T, R> resultHandler) { return () -> resultHandler.apply(supplier.get()); } private  SupplierUtils(); static Supplier<R> andThen(Supplier<T> supplier, Function<T, R> resultHandler); static Supplier<R> andThen(Supplier<T> supplier,
        BiFunction<T, Throwable, R> handler); static Supplier<T> recover(Supplier<T> supplier,
        Predicate<T> resultPredicate, UnaryOperator<T> resultHandler); static Supplier<T> recover(Supplier<T> supplier,
        Function<Throwable, T> exceptionHandler); static Supplier<T> recover(Supplier<T> supplier,
        List<Class<? extends Throwable>> exceptionTypes,
        Function<Throwable, T> exceptionHandler); static Supplier<T> recover(Supplier<T> supplier,
        Class<X> exceptionType,
        Function<Throwable, T> exceptionHandler); static Supplier<R> andThen(Supplier<T> supplier, Function<T, R> resultHandler,
        Function<Throwable, R> exceptionHandler); }
SupplierUtils { public static <T, R> Supplier<R> andThen(Supplier<T> supplier, Function<T, R> resultHandler) { return () -> resultHandler.apply(supplier.get()); } private  SupplierUtils(); static Supplier<R> andThen(Supplier<T> supplier, Function<T, R> resultHandler); static Supplier<R> andThen(Supplier<T> supplier,
        BiFunction<T, Throwable, R> handler); static Supplier<T> recover(Supplier<T> supplier,
        Predicate<T> resultPredicate, UnaryOperator<T> resultHandler); static Supplier<T> recover(Supplier<T> supplier,
        Function<Throwable, T> exceptionHandler); static Supplier<T> recover(Supplier<T> supplier,
        List<Class<? extends Throwable>> exceptionTypes,
        Function<Throwable, T> exceptionHandler); static Supplier<T> recover(Supplier<T> supplier,
        Class<X> exceptionType,
        Function<Throwable, T> exceptionHandler); static Supplier<R> andThen(Supplier<T> supplier, Function<T, R> resultHandler,
        Function<Throwable, R> exceptionHandler);  }