### Question:
MediaTypeResolver extends MappingMediaTypeFileExtensionResolver { public MediaType resolveFromExtension(String extension) { Assert.notNull(extension, "extension must not be null"); MediaType mediaType = super.lookupMediaType(extension.toLowerCase(Locale.ENGLISH)); if (mediaType == null) { mediaType = fallbackMediaType; } return mediaType; } MediaTypeResolver(Map<String, MediaType> mediaTypes); MediaType resolveFromExtension(String extension); MediaType resolveFromFilename(String fileName);  }### Answer:
@Test public void testResolve() { Map<String, MediaType> map = new HashMap<>(); map.put("png", MediaType.IMAGE_PNG); MediaTypeResolver resolver = new MediaTypeResolver(map); assertThat(resolver.resolveFromExtension("png"), is(MediaType.IMAGE_PNG)); assertThat(resolver.resolveFromExtension("PNG"), is(MediaType.IMAGE_PNG)); assertThat(resolver.resolveFromExtension("hoge"), is(MediaType.APPLICATION_OCTET_STREAM)); }