### Question:
XMLExpressionsUtil extends XPathUtil { public Expression parseExpression(final Node expressionParentNode) throws InvalidFormDefinitionException { return parseExpression(NON_APPLICABLE_PREFIX, expressionParentNode); } protected  XMLExpressionsUtil(); static synchronized XMLExpressionsUtil getInstance(); List<List<Expression>> parseExpressionsArray(final Node expressionsNode); List<List<Expression>> parseExpressionsArray(final String expressionParentName, final Node expressionsNode); List<Expression> parseExpressionsList(final Node expressionsNode); List<Expression> parseExpressionsList(final String expressionParentName, final Node expressionsNode); List<Expression> parseExpressionsDependenciesList(final Node dependenciesNode); Expression parseExpression(final Node expressionParentNode); Expression parseExpression(final String expressionParentName, final Node expressionParentNode); static String NON_APPLICABLE_PREFIX; }### Answer:
@Test public void should_parseExpression_do_not_modify_dependencies() throws Exception { XMLExpressionsUtil xmlExpressionsUtil = new XMLExpressionsUtil(); String expressionParentNodeName = "script"; String expressionTagName = "input-parameter"; String fileName = "formsWithExpressionDependencies.xml"; File xmlFile = new File(getClass().getClassLoader().getResource(fileName).toURI()); if(!xmlFile.exists()){ throw new IllegalStateException("Recource File missing:" + fileName); } DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); Document doc = dBuilder.parse(xmlFile); Node expressionParentNode = null; NodeList nodeList = doc.getElementsByTagName(expressionTagName); for (int i = 0; i < nodeList.getLength(); i++) { if(nodeList.item(i).getAttributes().getNamedItem("name").getNodeValue().equals(expressionParentNodeName)){ expressionParentNode = nodeList.item(i); } } assertNotNull("Cannot retrieve the Expression Node with name: "+ expressionParentNodeName , expressionParentNode); Expression generatedExpression = xmlExpressionsUtil.parseExpression(expressionParentNodeName, expressionParentNode); assertEquals("script:<pattern-expression>",generatedExpression.getName()); assertEquals(generatedExpression.getDependencies().get(0).getName(), "myId"); }