Memoize any method call.