public static <T> Try<T> apply(final CheckedSupplier<? extends T> supplier) {
    try {
      return fromValue(supplier.get());
    } catch (final Exception e) {
      return fromError(e);
    }
  }
public static < T > Try < T > apply ( final CheckedSupplier < ? extends T > supplier ) { try { return fromValue ( supplier . get ( ) ) ; } catch ( final Exception e ) { return fromError ( e ) ; } }
Creates new either {@link Success} or {@link Failure} Try by given supplier result.
In case supplier throws exception, {@link Failure} Try will be returned.

@param supplier computation value supplier
@param <T>      computation type
@return either {@link Success}, or {@link Failure} by supplier result