code: @Trivial
      public static String typeToString(MediaType type, List<String> ignoreParams) {
          if (type == null) {
              throw new IllegalArgumentException("MediaType parameter is null");
          }
          StringBuilder sb = new StringBuilder();
          sb.append(type.getType()).append('/').append(type.getSubtype());
  
          Map<String, String> params = type.getParameters();
          if (params != null) {
              for (Iterator<Map.Entry<String, String>> iter = params.entrySet().iterator();
                  iter.hasNext();) {
                  Map.Entry<String, String> entry = iter.next();
                  if (ignoreParams != null && ignoreParams.contains(entry.getKey())) {
                      continue;
                  }
                  sb.append(';').append(entry.getKey()).append('=').append(entry.getValue());
              }
          }
  
          return sb.toString();
      }
docs: to the implementation