@Override
  @SuppressWarnings("unchecked")
  public <T> T newInstance(final Target<T> target) {
    checkNotNull(target, "Argument target must be not null");

    final Map<String, MethodHandler> nameToHandler = targetToHandlersByName.apply(target);
    final Map<Method, MethodHandler> methodToHandler = new HashMap<>();
    final List<DefaultMethodHandler> defaultMethodHandlers = new ArrayList<>();

    for (final Method method : target.type().getMethods()) {
      if (isDefault(method)) {
        final DefaultMethodHandler handler = new DefaultMethodHandler(method);
        defaultMethodHandlers.add(handler);
        methodToHandler.put(method, handler);
      } else {
        methodToHandler.put(method, nameToHandler.get(Feign.configKey(target.type(), method)));
      }
    }

    final InvocationHandler handler = factory.create(target, methodToHandler);
    final T proxy =
        (T)
            Proxy.newProxyInstance(
                target.type().getClassLoader(), new Class<?>[] {target.type()}, handler);

    for (final DefaultMethodHandler defaultMethodHandler : defaultMethodHandlers) {
      defaultMethodHandler.bindTo(proxy);
    }

    return proxy;
  }
Allows Feign interfaces to return Vert.x {@link io.vertx.core.Future Future}s.

@author Alexei KLENIN
@author Gordon McKinney
vertx/feign-vertx/src/main/java/feign/VertxFeign.java