### Question:
ImmutableMediaType implements MediaType { @Override public Map<String,String> parameters() { return this.parameters; } ImmutableMediaType(final MediaRangeSyntax syntax, final String type, final String subtype, String suffix, final Map<String, String> parameters); @Override String type(); @Override String subType(); @Override Charset charset(); @Override String suffix(); @Override Map<String,String> parameters(); @Override boolean isWildcard(); @Override String toHeader(); @Override int hashCode(); @Override boolean equals(final Object other); @Override String toString();  }### Answer:
@Test public void constructorAcceptsNullParameters() { ImmutableMediaType sut=new ImmutableMediaType(MediaRangeSyntax.RFC7230,"type","subtype",null,null); assertThat(sut.parameters(),notNullValue()); assertThat(sut.parameters().isEmpty(),equalTo(true)); }
@Test public void canParseMediaTypesWithUnquotedParameterValues() throws Exception { final MediaType actual=verifyParam("myparam", "unquoted-value"); assertThat(actual.parameters().get("myparam"),equalTo("unquoted-value")); }
@Test public void canParseMediaTypesWithQuotedParameterValues() throws Exception { final MediaType actual = verifyParam("myparam", "\"quoted-value\""); assertThat(actual.parameters().get("myparam"),equalTo("\"quoted-value\"")); }
@Test public void canParseMediaTypesWithQuotedParameterValuesHavingQuotedPairs() throws Exception { final MediaType actual = verifyParam("myparam", "\"quoted\\-value\""); assertThat(actual.parameters().get("myparam"),equalTo("\"quoted\\-value\"")); }
@Test public void canParseMediaTypesWithWeirdParameterNames() throws Exception { final MediaType actual = verifyParam("!#$%&'*+-.^_`|~", "\"quoted-value\""); assertThat(actual.parameters().get("!#$%&'*+-.^_`|~"),equalTo("\"quoted-value\"")); }
@Test public void canParseMediaTypesWithWeirdUnquotedParameterValues() throws Exception { final MediaType actual=verifyParam("myparam", "!#$%&'*+-.^_`|~"); assertThat(actual.parameters().get("myparam"),equalTo("!#$%&'*+-.^_`|~")); }
@Test public void canParseMediaTypesWithWeirdQuotedParameterValues() throws Exception { final MediaType actual=verifyParam("myparam", "\"!#$%&'*+-.^_`|~\""); assertThat(actual.parameters().get("myparam"),equalTo("\"!#$%&'*+-.^_`|~\"")); }