### Question:
TranscribeUtils { public static String extractMediaType(String mimeType) { if (mimeType != null && mimeType.contains("/") && !mimeType.endsWith("/") && mimeType.chars().filter(c -> c == '/').count() == 1) { return mimeType.substring(mimeType.indexOf("/") + 1, mimeType.length()); } return ""; }  static String getFirstWords(String text, int numberOfWords); static String extractMediaType(String mimeType); static Predicate<T> distinctByProperty(Function<? super T, ?> propertyExtractor); static List<TranscribeItem> clone(List<TranscribeItem> items); static String getText(List<TranscribeItem> items);  }### Answer:
@Test public void extractMediaType_video() { String mimeType = "video/mp4"; String expectedResult = "mp4"; String actualResult = TranscribeUtils.extractMediaType(mimeType); assertEquals(expectedResult, actualResult); }
@Test public void extractMediaType_audio() { String mimeType = "audio/mp3"; String expectedResult = "mp3"; String actualResult = TranscribeUtils.extractMediaType(mimeType); assertEquals(expectedResult, actualResult); }
@Test public void extractMediaType_More_Slashes() { String mimeType = "video/mp4/mistake"; String expectedResult = ""; String actualResult = TranscribeUtils.extractMediaType(mimeType); assertEquals(expectedResult, actualResult); }
@Test public void extractMediaType_Ends_With_Slash() { String mimeType = "video/"; String expectedResult = ""; String actualResult = TranscribeUtils.extractMediaType(mimeType); assertEquals(expectedResult, actualResult); }
@Test public void extractMediaType_No_Slash() { String mimeType = "video"; String expectedResult = ""; String actualResult = TranscribeUtils.extractMediaType(mimeType); assertEquals(expectedResult, actualResult); }
@Test public void extractMediaType_Empty_String() { String mimeType = ""; String expectedResult = ""; String actualResult = TranscribeUtils.extractMediaType(mimeType); assertEquals(expectedResult, actualResult); }
@Test public void extractMediaType_Null() { String mimeType = null; String expectedResult = ""; String actualResult = TranscribeUtils.extractMediaType(mimeType); assertEquals(expectedResult, actualResult); }