code: public static List<MediaType> parseMediaTypes(List<String> mediaTypes) {
          if (CollectionUtils.isEmpty(mediaTypes)) {
              return Collections.emptyList();
          } else if (mediaTypes.size() == 1) {
              return parseMediaTypes(mediaTypes.get(0));
          } else {
              List<MediaType> result = new ArrayList<>(8);
              for (String mediaType : mediaTypes) {
                  result.addAll(parseMediaTypes(mediaType));
              }
              return result;
          }
      }
docs: Parse the given list of (potentially) comma-separated strings into a list of {@code MediaType} objects.
  
  <p>This method can be used to parse an Accept or Content-Type header.
  
  @param mediaTypes the string to parse.
  
  @return the list of media types.
  
  @throws InvalidMediaTypeException if the media type value cannot be parsed.