### Question:
MediaTypes { public static MediaType wildcard() { return new ImmutableMediaType(MediaTypes.preferredSyntax(),WILDCARD_TYPE,WILDCARD_TYPE,null,null); } private  MediaTypes(); static MediaRangeSyntax preferredSyntax(); static void preferredSyntax(MediaRangeSyntax syntax); static MediaType wildcard(); static MediaType wildcard(String type); static MediaType wildcard(String type, String suffix); static MediaType fromString(final String mediaType); static MediaType of(String type, String subtype); static MediaType of(String type, String subtype, String suffix); static MediaTypeBuilder from(MediaType mediaType); static boolean isWildcardType(final MediaType mediaType); static boolean isWildcardSubType(final MediaType mediaType); static boolean isStructured(final MediaType mediaType); static boolean includes(final MediaType one, final MediaType other); static boolean areCompatible(final MediaType one, final MediaType other); static String toHeader(final MediaType mediaType); static boolean isStandardParameter(final String parameter); static final String WILDCARD_TYPE; static final String PARAM_CHARSET; }### Answer:
@Test public void createsSimpleWildcard() { MediaType mt=MediaTypes.wildcard(); assertThat(mt.type(),equalTo("*")); assertThat(mt.subType(),equalTo("*")); assertThat(mt.suffix(),nullValue()); assertThat(mt.charset(),nullValue()); assertThat(mt.parameters().size(),equalTo(0)); }
@Test public void createsSimpleSubtypeWildcard() { MediaType mt=MediaTypes.wildcard("application"); assertThat(mt.type(),equalTo("application")); assertThat(mt.subType(),equalTo("*")); assertThat(mt.suffix(),nullValue()); assertThat(mt.charset(),nullValue()); assertThat(mt.parameters().size(),equalTo(0)); }
@Test public void createsStructuredSubtypeWildcard() { MediaType mt=MediaTypes.wildcard("application","xml"); assertThat(mt.type(),equalTo("application")); assertThat(mt.subType(),equalTo("*")); assertThat(mt.suffix(),equalTo("xml")); assertThat(mt.charset(),nullValue()); assertThat(mt.parameters().size(),equalTo(0)); }
@Test public void cannotCreateWildcardStructuredMediaType() { try { MediaTypes.wildcard("*","xml"); fail("Should not be able to create **+xml')")); } }