code: public static <V> Closure<V> buildMemoizeFunction(final MemoizeCache<Object, Object> cache, final Closure<V> closure) {
          return new MemoizeFunction<V>(cache, closure);
      }
docs: Creates a new closure delegating to the supplied one and memoizing all return values by the arguments.
  
  The supplied cache is used to store the memoized values and it is the cache's responsibility to put limits
  on the cache size or implement cache eviction strategy.
  The LRUCache, for example, allows to set the maximum cache size constraint and implements
  the LRU (Last Recently Used) eviction strategy.
  
  @param cache A map to hold memoized return values
  @param closure The closure to memoize
  @param <V> The closure's return type
  @return A new memoized closure