Code example for UndeclaredThrowableException

0
            } else if (cause instanceof Error) {
                throw (Error) cause;
            } else if (cause instanceof Exception) {
                throw (Exception) cause;
            } 
            throw new UndeclaredThrowableException(cause);
        } 
    } 
 
    /** 
     * Gets a value from the {@link Future} without throwing an exception. 
     *  
     * @param <T> 
     *            the value type 
     *  
     * @param future 
     *            the future 
     * @return a value 
     */ 
    public static <T> T getQuietly(Future<T> future) {
        if (future == null) {