docs: public Object invokeMethod(String name, Object args) {
          if (args != null && Object[].class.isAssignableFrom(args.getClass())) {
              Object[] arr = (Object[]) args;
              if (arr.length == 0) {
                  return setAndGetContent(name, new HashMap<String, Object>());
              } else if (arr.length == 1) {
                  if (arr[0] instanceof Closure) {
                      return setAndGetContent(name, JsonDelegate.cloneDelegateAndGetContent((Closure) arr[0]));
                  } else if (arr[0] instanceof Map) {
                      return setAndGetContent(name, arr[0]);
                  }
              } else if (arr.length == 2) {
                  final Object first = arr[0];
                  final Object second = arr[1];
                  if (second instanceof Closure) {
                      final Closure closure = (Closure)second;
                      if (first instanceof Map) {
                          Map subMap = new LinkedHashMap();
                          subMap.putAll((Map) first);
                          subMap.putAll(JsonDelegate.cloneDelegateAndGetContent(closure));
  
                          return setAndGetContent(name, subMap);
                      } else if (first instanceof Iterable) {
                          List<Map<String, Object>> list = collectContentForEachEntry((Iterable) first, closure);
  
                          return setAndGetContent(name, list);
                      } else if (first != null && first.getClass().isArray()) {
                          final Iterable coll = Arrays.asList((Object[])first);
                          List<Map<String, Object>> list = collectContentForEachEntry(coll, closure);
  
                          return setAndGetContent(name, list);
                      }
                  }
              }
  
              throw new JsonException("Expected no arguments, a single map, a single closure, or a map and closure as arguments.");
          } else {
              return setAndGetContent(name, new HashMap<String, Object>());
          }
      }