code: public static List<MediaType> getProducibleMediaTypes(final ContainerRequest containerRequest,
                                                            final ExtendedUriInfo extendedUriInfo,
                                                            final Ref<String> varyHeaderValue) {
          final List<MediaType> producedTypes = getResourceMethodProducibleTypes(extendedUriInfo);
          final MediaType[] mediaTypes = producedTypes.toArray(new MediaType[producedTypes.size()]);
  
          final List<Variant> variants = VariantSelector.selectVariants(containerRequest, Variant.mediaTypes(mediaTypes)
                  .build(), varyHeaderValue == null ? Refs.emptyRef() : varyHeaderValue);
  
          return Lists.transform(variants, variant -> MediaTypes.stripQualityParams(variant.getMediaType()));
      }
docs: Get media types for which the {@link org.glassfish.jersey.server.mvc.spi.ResolvedViewable resolved viewable} could be
  produced.
  
  @param containerRequest request to obtain acceptable media types.
  @param extendedUriInfo  uri info to obtain resource method from and its producible media types.
  @param varyHeaderValue  Vary header reference.
  @return list of producible media types.