### Question:
AllureResultsUtils { public static String getExtensionByMimeType(String type) { MimeTypes types = getDefaultMimeTypes(); try { return types.forName(type).getExtension(); } catch (Exception e) { LOGGER.warn("Can't detect extension for MIME-type " + type, e); return ""; } } AllureResultsUtils(); static File getResultsDirectory(); static boolean createDirectories(File dir); static void setResultsDirectory(File resultsDirectory); static void writeTestSuiteResult(TestSuiteResult testSuite); static void writeTestSuiteResult(TestSuiteResult testSuite, File testSuiteResultFile); static Marshaller marshaller(Class<?> clazz); static Marshaller createMarshallerForClass(Class<?> clazz); static void setPropertySafely(Marshaller marshaller, String name, Object value); static boolean deleteAttachment(Attachment attachment); static Attachment writeAttachmentSafely(byte[] attachment, String title, String type); static Attachment writeAttachmentWithErrorMessage(Throwable throwable, String title); static Attachment writeAttachment(byte[] attachment, String title, String type); static Attachment writeAttachment(byte[] attachment, String title); static String generateAttachmentName(); static String getExtensionByMimeType(String type);  }### Answer:
@Test public void getExtensionByValidMimeTypeTest() throws Exception { assertThat(AllureResultsUtils.getExtensionByMimeType("text/plain"), is(".txt")); }
@Test public void getExtensionByInvalidMimeTypeTest() throws Exception { assertThat(AllureResultsUtils.getExtensionByMimeType("text/plai"), is("")); }