### Question:
Helper { public static boolean isXMLFile(File file) throws ParserConfigurationException { DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); try { builder.parse(file); } catch (Exception e) { return false; } return true; } private  Helper(); static File[] getFilesFromPath(Path path); static File[] getFilesFromPath(Path path, FileFilter filter); static File[] getFilesFromResourcePath(Path path); static File[] getFilesFromResourcePath(Path path, FileFilter filter); static byte[] generateRandomBytes(int length); static boolean isZipFile(InputStream stream); static boolean isZipFile(File file); static boolean isXMLFile(File file); static void deleteFile(String file); static String extractSignature(String file, int index); static void serialize(T object, File file); static void serialize(T object, String filename); static T deserializer(File file); static T deserializer(String filename); static OutputStream bufferedOutputStream(File file); static X509Certificate loadCertificate(String filePath); static boolean hasSpecialCharacters(String fileName); static String getIdentifier(String identifier); static SignaturePolicyProvider getBdocSignaturePolicyProvider(DSSDocument signature); static List<byte[]> getAllFilesFromContainerAsBytes(Container container); static List<byte[]> getAllFilesFromContainerPathAsBytes(String pathFrom); static void saveAllFilesFromContainerToFolder(Container container, String path); static void saveAllFilesFromContainerPathToFolder(String pathFrom, String pathTo); static void deleteTmpFiles(); static boolean isPdfFile(String file); static String bytesToHex(byte[] bytes, int maxLen); static void printWarningSection(Logger logger, String warningMessage); static void printErrorSection(Logger logger, String errorMessage); static final String SPECIAL_CHARACTERS; }### Answer:
@Test public void testIsXMLFileWhenFileIsNotXMLFile() throws Exception { Assert.assertFalse(Helper.isXMLFile(new File("src/test/resources/testFiles/helper-files/test.txt"))); }
@Test public void testIsXMLFileWhenFileIsXMLFile() throws Exception { Assert.assertTrue(Helper.isXMLFile(new File(this.createXMLFile()))); }