@Override
   public String toString() {
      if (!hasParameters()) return typeSubtype;
      StringBuilder builder = new StringBuilder().append(typeSubtype);

      String strParams = this.params.entrySet().stream()
            .map(e -> e.getKey() + "=" + e.getValue())
            .collect(Collectors.joining("; "));

      return builder.append("; ").append(strParams).toString();
   }
@Test
   public void testToString() {
      assertEquals("application/xml; q=0.9",
            new MediaType("application", "xml", Map.of("q", "0.9")).toString());
      assertEquals("text/csv", new MediaType("text", "csv").toString());
      assertEquals("foo/bar; a=2", new MediaType("foo", "bar", Map.of("a", "2")).toString());
      String type = new MediaType("foo", "bar", Map.of("a", "2", "b", "1", "c", "2")).toString();
      assertTrue(type.startsWith("foo/bar; "));
      assertTrue(type.contains("; a=2"));
      assertTrue(type.contains("; b=1"));
      assertTrue(type.contains("; c=2"));
      assertEquals("a/b; p=1", MediaType.fromString("a/b; p=1; q=2").toStringExcludingParam("q"));
   }