public static <T extends AutoCloseable> Memoized<T, ?> of(Supplier<T> factory) {
        return new Memoized<>(factory, AutoCloseable::close);
    }
Returns a generic AutoCloseable Memoized with the given AutoCloseable-supplier.
vespajlib/src/main/java/com/yahoo/yolean/concurrent/Memoized.java