code: public static Map<String, Object> cloneDelegateAndGetContent(Closure<?> c) {
          JsonDelegate delegate = new JsonDelegate();
          Closure<?> cloned = (Closure<?>) c.clone();
          cloned.setDelegate(delegate);
          cloned.setResolveStrategy(Closure.DELEGATE_FIRST);
          cloned.call();
  
          return delegate.getContent();
      }
docs: Factory method for creating <code>JsonDelegate</code>s from closures.
  
  @param c closure representing JSON objects
  @return an instance of <code>JsonDelegate</code>