### Question:
ContentTypeExtractor { public ContentType extractContentType(String filename) { String extension = FilenameUtils.getExtension(filename).toLowerCase(); if (!contentTypeMappings.containsKey(extension)) { throw new IllegalArgumentException("Files with extension " + extension + " are not supported"); } return contentTypeMappings.get(extension); }  ContentType extractContentType(String filename);  }### Answer:
@Test public void extractContentType() { ContentType contentType = contentTypeExtractor.extractContentType("filename.pdf"); assertEquals(ContentType.PDF, contentType); }
@Test public void extractContentType_LOWER_CASE() { ContentType contentType = contentTypeExtractor.extractContentType("filename.DOC"); assertEquals(ContentType.DOC, contentType); }
@Test(expected = IllegalArgumentException.class) public void extractContentType_NOT_SUPPORTED() { contentTypeExtractor.extractContentType("filename.zip"); }