code: public static void configureThriftServices(
              ServerBuilder server, List<ThriftServiceRegistrationBean> beans,
              @Nullable MeterIdPrefixFunctionFactory meterIdPrefixFunctionFactory,
              @Nullable String docsPath) {
          requireNonNull(server, "server");
          requireNonNull(beans, "beans");
  
          final List<TBase<?, ?>> docServiceRequests = new ArrayList<>();
          final Map<String, Collection<HttpHeaders>> docServiceHeaders = new HashMap<>();
          beans.forEach(bean -> {
              Service<HttpRequest, HttpResponse> service = bean.getService();
              for (Function<Service<HttpRequest, HttpResponse>, ? extends Service<HttpRequest, HttpResponse>>
                      decorator : bean.getDecorators()) {
                  service = service.decorate(decorator);
              }
              service = setupMetricCollectingService(service, bean, meterIdPrefixFunctionFactory);
              server.service(bean.getPath(), service);
              docServiceRequests.addAll(bean.getExampleRequests());
              ThriftServiceUtils.serviceNames(bean.getService())
                                .forEach(serviceName -> docServiceHeaders
                                        .put(serviceName,
                                             bean.getExampleHeaders()));
          });
  
          if (!Strings.isNullOrEmpty(docsPath)) {
              final DocServiceBuilder docServiceBuilder = new DocServiceBuilder();
              docServiceBuilder.exampleRequest(docServiceRequests);
              for (Entry<String, Collection<HttpHeaders>> entry : docServiceHeaders.entrySet()) {
                  docServiceBuilder.exampleHttpHeaders(entry.getKey(), entry.getValue());
              }
              server.serviceUnder(docsPath, docServiceBuilder.build());
          }
      }
docs: Adds Thrift services to the specified {@link ServerBuilder}.