docs: public void setNewInstanceResolver(final Object newInstanceResolver) {
          if (newInstanceResolver instanceof NewInstanceResolver) {
              this.newInstanceResolver = (NewInstanceResolver) newInstanceResolver;
          } else if (newInstanceResolver instanceof Closure) {
              final ObjectGraphBuilder self = this;
              this.newInstanceResolver = new NewInstanceResolver() {
                  public Object newInstance(Class klass, Map attributes)
                          throws InstantiationException, IllegalAccessException {
                      Closure cls = (Closure) newInstanceResolver;
                      cls.setDelegate(self);
                      return cls.call(klass, attributes);
                  }
              };
          } else {
              this.newInstanceResolver = new DefaultNewInstanceResolver();
          }
      }