### Question:
PathResolver { public String pathOf(String templateId, String identifier) { String result = getMapper().getPath(templateId, identifier); if (StringUtils.isBlank(result) && getMapper().getClassName(identifier).equals("COMPOSITION")) { StringBuilder stringBuilder = new StringBuilder(); Containment containment = (Containment) getMapper().getContainer(identifier); stringBuilder.append("/composition["); stringBuilder.append(containment.getArchetypeId()); stringBuilder.append("]"); result = stringBuilder.toString(); } return result; } PathResolver(KnowledgeCacheService knowledgeCache, IdentifierMapper mapper); String pathOf(String templateId, String identifier); String entryRoot(String templateId); boolean hasPathExpression(); String rootOf(String identifier); String classNameOf(String identifier); IdentifierMapper getMapper();  }### Answer:
@Test public void testResolvePaths() { String query = "select\n" + "a, d\n" + "from EHR e\n" + "contains COMPOSITION a[openEHR-EHR-COMPOSITION.health_summary.v1]" + " CONTAINS ACTION d[openEHR-EHR-ACTION.immunisation_procedure.v1]"; AqlExpression aqlExpression = new AqlExpression().parse(query); Contains contains = new Contains(aqlExpression.getParseTree(), knowledge).process(); PathResolver cut = new PathResolver(knowledge, contains.getIdentifierMapper()); assertThat(cut.pathOf("IDCR - Immunisation summary.v0","d")).isEqualTo("/content[openEHR-EHR-ACTION.immunisation_procedure.v1]"); assertThat(cut.pathOf("IDCR - Immunisation summary.v0","a")).isEqualTo("/composition[openEHR-EHR-COMPOSITION.health_summary.v1]"); }