@Nullable
    @Override
    public ServiceDescriptor findServiceDescriptor(Class<?> clientType) {
        final String clientTypeName = clientType.getName();
        if (!clientTypeName.endsWith("Stub")) {
            return null;
        }

        try {
            final Class<?> enclosingClass =
                    clientType.getDeclaredField("delegateStub").getType().getEnclosingClass();
            final Method getServiceDescriptorMethod = enclosingClass.getDeclaredMethod("getServiceDescriptor");
            return (ServiceDescriptor) getServiceDescriptorMethod.invoke(null);
        } catch (NoSuchMethodException | IllegalAccessException |
                InvocationTargetException | NoSuchFieldException e) {
            throw new ServiceDescriptorResolutionException(getClass().getSimpleName(), Exceptions.peel(e));
        }
    }
A gRPC client stub factory for <a href="https://github.com/salesforce/reactive-grpc">reactive-grpc</a>.
grpc/src/main/java/com/linecorp/armeria/internal/client/grpc/ReactorGrpcClientStubFactory.java