public static Object unwrap(final Class<?> type, final Object object) throws Exception {
        if (object == null) {
            return null;
        }
        if (type == null) {
            return object;
        }
        if (Callable.class.equals(type)) {
            assert (object instanceof Callable);
            return ((Callable<?>) object).call();
        }

        if ("java.util.function.Supplier".equals(type.getName())) {
            return findMethodByName(type, "get").invoke(object, (Object[]) null);
        }

        return object;
    }
public static Object unwrap ( final Class < ? > type , final Object object ) throws Exception { if ( object == null ) { return null ; } if ( type == null ) { return object ; } if ( Callable . class . equals ( type ) ) { assert ( object instanceof Callable ) ; return ( ( Callable < ? > ) object ) . call ( ) ; } if ( "java.util.function.Supplier" . equals ( type . getName ( ) ) ) { return findMethodByName ( type , "get" ) . invoke ( object , ( Object [ ] ) null ) ; } return object ; }
Unwrap a given object until we assume it is a value. Supports Callable and Supplier so far.

@param type
@param object
@return object if it's a value. Unwrapped object if its a Callable or a Supplier
@throws Exception
may be thrown by given objects method