// Path: src/de/neuland/firefly/utils/XMLUtil.java
// public class XMLUtil {
//     public static String loadAndNormalizeXML(File xmlFile) throws ParserConfigurationException, SAXException, IOException, TransformerException {
//         DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
//         DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
//         Document doc = dBuilder.parse(xmlFile);
// 
//         removeRecursively(doc);
//         doc.normalizeDocument();
// 
//         TransformerFactory tf = TransformerFactory.newInstance();
//         Transformer transformer = tf.newTransformer();
//         transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
//         transformer.setOutputProperty(OutputKeys.INDENT, "no");
//         StringWriter normalizedXml = new StringWriter();
//         transformer.transform(new DOMSource(doc), new StreamResult(normalizedXml));
//         return normalizedXml.toString();
//     }
// 
//     public static <T> T loadXML(Class<T> type, File sourceFile) {
//         return loadXML(type, null, sourceFile);
//     }
// 
//     public static <T> T loadXML(Class<T> type, String schemaLocation, File sourceFile) {
//         try {
//             Unmarshaller unmarshaller = JAXBContext.newInstance(type).createUnmarshaller();
//             if (isNotEmpty(schemaLocation)) {
//                 unmarshaller.setSchema(SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI).newSchema(type.getClassLoader().getResource(schemaLocation)));
//             }
//             return (T) unmarshaller.unmarshal(sourceFile);
//         } catch (JAXBException | SAXException e) {
//             throw new RuntimeException(e);
//         }
//     }
// 
//     static void removeRecursively(Node node) {
//         if (node == null) {
//             return;
//         }
//         if (isIrrelevantNode(node)) {
//             removeRecursively(node.getNextSibling());
//             node.getParentNode().removeChild(node);
//         } else {
//             NodeList childNotes = node.getChildNodes();
//             for (int i = 0; i < childNotes.getLength(); i++) {
//                 removeRecursively(childNotes.item(i));
//             }
//         }
//     }
// 
//     private static boolean isIrrelevantNode(Node node) {
//         if (COMMENT_NODE == node.getNodeType()) {
//             return true;
//         }
//         return TEXT_NODE == node.getNodeType() && isBlank(node.getTextContent());
//     }
// }


import de.neuland.firefly.utils.XMLUtil;
import java.io.File;
import java.net.URL;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
package de.neuland.firefly;





public class TestUtils {
    public static void unwrapException(RuntimeException e) throws Throwable {
        if (e.getCause() != null) {
            throw e.getCause();
        } else {
            throw e;
        }
    }

    public static <T> T loadXML(Class<T> type, String xmlFile) {
// Path: src/de/neuland/firefly/utils/XMLUtil.java
// public class XMLUtil {
//     public static String loadAndNormalizeXML(File xmlFile) throws ParserConfigurationException, SAXException, IOException, TransformerException {
//         DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
//         DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
//         Document doc = dBuilder.parse(xmlFile);
// 
//         removeRecursively(doc);
//         doc.normalizeDocument();
// 
//         TransformerFactory tf = TransformerFactory.newInstance();
//         Transformer transformer = tf.newTransformer();
//         transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
//         transformer.setOutputProperty(OutputKeys.INDENT, "no");
//         StringWriter normalizedXml = new StringWriter();
//         transformer.transform(new DOMSource(doc), new StreamResult(normalizedXml));
//         return normalizedXml.toString();
//     }
// 
//     public static <T> T loadXML(Class<T> type, File sourceFile) {
//         return loadXML(type, null, sourceFile);
//     }
// 
//     public static <T> T loadXML(Class<T> type, String schemaLocation, File sourceFile) {
//         try {
//             Unmarshaller unmarshaller = JAXBContext.newInstance(type).createUnmarshaller();
//             if (isNotEmpty(schemaLocation)) {
//                 unmarshaller.setSchema(SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI).newSchema(type.getClassLoader().getResource(schemaLocation)));
//             }
//             return (T) unmarshaller.unmarshal(sourceFile);
//         } catch (JAXBException | SAXException e) {
//             throw new RuntimeException(e);
//         }
//     }
// 
//     static void removeRecursively(Node node) {
//         if (node == null) {
//             return;
//         }
//         if (isIrrelevantNode(node)) {
//             removeRecursively(node.getNextSibling());
//             node.getParentNode().removeChild(node);
//         } else {
//             NodeList childNotes = node.getChildNodes();
//             for (int i = 0; i < childNotes.getLength(); i++) {
//                 removeRecursively(childNotes.item(i));
//             }
//         }
//     }
// 
//     private static boolean isIrrelevantNode(Node node) {
//         if (COMMENT_NODE == node.getNodeType()) {
//             return true;
//         }
//         return TEXT_NODE == node.getNodeType() && isBlank(node.getTextContent());
//     }
// }


// Path: testsrc/de/neuland/firefly/TestUtils.java
import de.neuland.firefly.utils.XMLUtil;
import java.io.File;
import java.net.URL;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

package de.neuland.firefly;





public class TestUtils {
    public static void unwrapException(RuntimeException e) throws Throwable {
        if (e.getCause() != null) {
            throw e.getCause();
        } else {
            throw e;
        }
    }

    public static <T> T loadXML(Class<T> type, String xmlFile) {
        T result = XMLUtil.loadXML(type, getFileFromClasspath(xmlFile));