code: public static Function<Service<HttpRequest, HttpResponse>,
              HttpEncodingService> contentEncodingDecorator(@Nullable String[] mimeTypes,
                                                            @Nullable String[] excludedUserAgents,
                                                            long minBytesToForceChunkedAndEncoding) {
          final Predicate<MediaType> encodableContentTypePredicate;
          if (mimeTypes == null || mimeTypes.length == 0) {
              encodableContentTypePredicate = contentType -> true;
          } else {
              final List<MediaType> encodableContentTypes =
                      Arrays.stream(mimeTypes).map(MediaType::parse).collect(toImmutableList());
              encodableContentTypePredicate = contentType ->
                      encodableContentTypes.stream().anyMatch(contentType::is);
          }
  
          final Predicate<HttpHeaders> encodableRequestHeadersPredicate;
          if (excludedUserAgents == null || excludedUserAgents.length == 0) {
              encodableRequestHeadersPredicate = headers -> true;
          } else {
              final List<Pattern> patterns =
                      Arrays.stream(excludedUserAgents).map(Pattern::compile).collect(toImmutableList());
              encodableRequestHeadersPredicate = headers -> {
                  // No User-Agent header will be converted to an empty string.
                  final String userAgent = headers.get(HttpHeaderNames.USER_AGENT, "");
                  return patterns.stream().noneMatch(pattern -> pattern.matcher(userAgent).matches());
              };
          }
  
          return delegate -> new HttpEncodingService(delegate,
                                                     encodableContentTypePredicate,
                                                     encodableRequestHeadersPredicate,
                                                     minBytesToForceChunkedAndEncoding);
      }
docs: Configures a decorator for encoding the content of the HTTP responses sent from the server.