@SuppressWarnings("unchecked")
    private static <T extends HttpHeaders> T injectBoundary(String boundary, T headers) {
        requireNonNull(headers, "headers");
        @Nullable
        MediaType contentType = headers.contentType();
        if (contentType != null) {
            checkArgument(contentType.isMultipart(),
                          "Content-Type: %s (expected: multipart content type)", contentType);
            contentType = contentType.withParameter(BOUNDARY_PARAMETER, boundary);
        } else {
            contentType = DEFAULT_MULTIPART_TYPE.withParameter(BOUNDARY_PARAMETER, boundary);
        }
        final MediaType contentTypeWithBoundary = contentType;
        return (T) headers.withMutations(builder -> builder.contentType(contentTypeWithBoundary));
    }
Returns a random boundary used for encoding multipart messages.
core/src/main/java/com/linecorp/armeria/common/multipart/DefaultMultipart.java