@Override
    public AbstractStub<?> createStub(final Class<? extends AbstractStub<?>> stubType, final Channel channel) {
        try {
            // Use the public static factory method
            final String methodName = getFactoryMethodName();
            final Class<?> enclosingClass = stubType.getEnclosingClass();
            final Method factoryMethod = enclosingClass.getMethod(methodName, Channel.class);
            return stubType.cast(factoryMethod.invoke(null, channel));
        } catch (final Exception e) {
            throw new BeanInstantiationException(stubType, "Failed to create gRPC client", e);
        }
    }
A factory for creating stubs provided by standard grpc Java library. This is an abstract super-type that can be
extended to support the different provided types.
grpc-client-spring-boot-starter/src/main/java/net/devh/boot/grpc/client/stubfactory/StandardJavaGrpcStubFactory.java