@Test
    public void testEquals() {
        new EqualsTester()
                .addEqualityGroup(
                        MediaType.create("text", "plain"),
                        MediaType.create("TEXT", "PLAIN"),
                        MediaType.parse("text/plain"),
                        MediaType.parse("TEXT/PLAIN"),
                        MediaType.create("text", "plain").withParameter("a", "1").withoutParameters())
                .addEqualityGroup(
                        MediaType.create("text", "plain").withCharset(UTF_8),
                        MediaType.create("text", "plain").withParameter("CHARSET", "UTF-8"),
                        MediaType.create("text", "plain")
                                 .withParameters(ImmutableMultimap.of("charset", "utf-8").asMap()),
                        MediaType.parse("text/plain;charset=utf-8"),
                        MediaType.parse("text/plain; charset=utf-8"),
                        MediaType.parse("text/plain;  charset=utf-8"),
                        MediaType.parse("text/plain; \tcharset=utf-8"),
                        MediaType.parse("text/plain; \r\n\tcharset=utf-8"),
                        MediaType.parse("text/plain; CHARSET=utf-8"),
                        MediaType.parse("text/plain; charset=\"utf-8\""),
                        MediaType.parse("text/plain; charset=\"\\u\\tf-\\8\""),
                        MediaType.parse("text/plain; charset=UTF-8"),
                        MediaType.parse("text/plain ; charset=utf-8"))
                .addEqualityGroup(MediaType.parse("text/plain; charset=utf-8; charset=utf-8"))
                .addEqualityGroup(
                        MediaType.create("text", "plain").withParameter("a", "value"),
                        MediaType.create("text", "plain").withParameter("A", "value"))
                .addEqualityGroup(
                        MediaType.create("text", "plain").withParameter("a", "VALUE"),
                        MediaType.create("text", "plain").withParameter("A", "VALUE"))
                .addEqualityGroup(
                        MediaType.create("text", "plain")
                                 .withParameters(ImmutableListMultimap.of("a", "1", "a", "2").asMap()),
                        MediaType.create("text", "plain")
                                 .withParameters(ImmutableListMultimap.of("a", "2", "a", "1").asMap()))
                .addEqualityGroup(MediaType.create("text", "csv"))
                .addEqualityGroup(MediaType.create("application", "atom+xml"))
                .testEquals();
    }
Tests for {@link MediaType}.

@author Gregory Kick
core/src/test/java/com/linecorp/armeria/common/MediaTypeTest.java