public MediaType withParameters(String attribute, Iterable<String> values) {
        checkNotNull(attribute);
        checkNotNull(values);
        String normalizedAttribute = normalizeToken(attribute);
        ImmutableListMultimap.Builder<String, String> builder = ImmutableListMultimap.builder();
        for (Entry<String, String> entry : parameters.entries()) {
            String key = entry.getKey();
            if (!normalizedAttribute.equals(key)) {
                builder.put(key, entry.getValue());
            }
        }
        for (String value : values) {
            builder.put(normalizedAttribute, normalizeParameterValue(normalizedAttribute, value));
        }
        MediaType mediaType = new MediaType(type, subtype, builder.build());
        // if the attribute isn't charset, we can just inherit the current parsedCharset
        if (!normalizedAttribute.equals(CHARSET_ATTRIBUTE)) {
            mediaType.parsedCharset = parsedCharset;
        }
        // Return one of the constants if the media type is a known type.
        return firstNonNull(KNOWN_TYPES.get(mediaType), mediaType);
    }
<em>Replaces</em> all parameters with the given attribute with parameters using the given
values. If there are no values, any existing parameters with the given attribute are
removed.

@throws IllegalArgumentException if either {@code attribute} or {@code values} is invalid
core/src/main/java/com/linecorp/armeria/common/MediaType.java