### Question:
ExtensionBasedMimeTypeDetector extends MimeTypeUtil implements MimeTypeDetector { public String mimeTypeOf( String name, InputStream content ) { return mimeTypeOf(name); } ExtensionBasedMimeTypeDetector();  ExtensionBasedMimeTypeDetector(ClassLoaderFactory classLoaderFactory);  ExtensionBasedMimeTypeDetector( Map<String, String> extensionsToMimeTypes );  ExtensionBasedMimeTypeDetector( Map<String, String> extensionsToMimeTypes,
                                           boolean initWithDefaults ); String mimeTypeOf( String name,
                              InputStream content ); static final MimeTypeDetectorConfig CONFIGURATION; }### Answer:
@Test public void shouldFindMimeTypeForExtenionsInStandardPropertiesFile() { assertThat(detector.mimeTypeOf("something.txt", stream), is("text/plain")); }
@Test public void shouldFindMimeTypeForOneCharacterExtension() { assertThat(detector.mimeTypeOf("something.gzip.Z", stream), is("application/x-compress")); }
@Test public void shouldFindMimeTypeForTwoCharacterExtension() { assertThat(detector.mimeTypeOf("something.sh", stream), is("application/x-sh")); }
@Test public void shouldFindMimeTypeForThreeCharacterExtension() { assertThat(detector.mimeTypeOf("something.png", stream), is("image/png")); }
@Test public void shouldNotFindMimeTypeForNameWithoutExtension() { assertThat(detector.mimeTypeOf("something", stream), is(nullValue())); }
@Test public void shouldNotFindMimeTypeForNameUnknownExtension() { assertThat(detector.mimeTypeOf("something.thisExtensionIsNotKnown", stream), is(nullValue())); }
@Test public void shouldNotFindMimeTypeForZeroLengthName() { assertThat(detector.mimeTypeOf(null, stream), is(nullValue())); }
@Test public void shouldNotFindMimeTypeForNameContainingWhitespace() { assertThat(detector.mimeTypeOf("/t /n ", stream), is(nullValue())); }
@Test public void shouldNotFindMimeTypeForNullName() { assertThat(detector.mimeTypeOf(null, stream), is(nullValue())); }
@Test public void shouldFindMimeTypeForUppercaseExtenionsInStandardPropertiesFile() { assertThat(detector.mimeTypeOf("something.TXT", stream), is("text/plain")); }
@Test public void shouldFindMimeTypeForNameWithTrailingWhitespace() { assertThat(detector.mimeTypeOf("something.txt \t", stream), is("text/plain")); }