final void accept(Iterable<MediaType> newAcceptTypes) {
        requireNonNull(newAcceptTypes, "newAcceptTypes");
        final int size = Iterables.size(newAcceptTypes);
        checkArgument(size > 0, "newAcceptTypes is empty");

        @SuppressWarnings("unchecked")
        List<MediaType> cachedAcceptTypes = (List<MediaType>) cache.get(HttpHeaderNames.ACCEPT);
        if (cachedAcceptTypes == null) {
            // Set new Accept headers
            final List<MediaType> copied = new ArrayList<>(size + 2);
            for (MediaType mediaType : newAcceptTypes) {
                copied.add(mediaType);
            }
            cachedAcceptTypes = copied;
        } else {
            if (cachedAcceptTypes instanceof ImmutableList) {
                // Make cached MediaTypes mutable
                cachedAcceptTypes = new ArrayList<>(cachedAcceptTypes);
            }

            assert cachedAcceptTypes instanceof ArrayList;
            final ArrayList<MediaType> mediaTypeList = (ArrayList<MediaType>) cachedAcceptTypes;
            // Merge old AcceptTypes with new one.
            for (MediaType newAcceptType : newAcceptTypes) {
                mediaTypeList.add(newAcceptType);
            }
        }

        if (cachedAcceptTypes.size() > 1) {
            cachedAcceptTypes.sort(HttpHeadersBase::compareMediaType);
        }

        cache.put(HttpHeaderNames.ACCEPT, cachedAcceptTypes);
        addObjectWithoutNotifying(HttpHeaderNames.ACCEPT, newAcceptTypes);
    }
Adds the specified {@code setCookies} with {@link HttpHeaderNames#SET_COOKIE}.
core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java