### Question:
ResourceLocator { public ST_Loc getAbsTo(ST_Loc to) { if (to == null) { return new ST_Loc(pwd()); } String loc = to.getLoc(); if (loc.startsWith("/")) { return new ST_Loc(loc); } LinkedList<String> wd = new LinkedList<>(this.workDir); String fileName; int indexOf = loc.lastIndexOf('/'); if (indexOf != -1) { this.cd(wd, loc.substring(0, indexOf + 1)); fileName = loc.substring(indexOf + 1); } else { fileName = loc; } String p = pwd(wd); if (p.endsWith("/")) { loc = p + fileName; } else { loc = p + "/" + fileName; } return new ST_Loc(loc); } private  ResourceLocator();  ResourceLocator(OFDDir ofdDir);  ResourceLocator(VirtualContainer vc); ResourceLocator save(); ResourceLocator restore(); String toAbsolutePath(ST_Loc path); String toAbsolutePath(String path); ResourceLocator restWd(); ResourceLocator cd(VirtualContainer vc); ResourceLocator cd(String path); ResourceLocator cd(LinkedList<String> workDir, String path); boolean exist(LinkedList<String> workDir); boolean dirExit(LinkedList<String> workDir); String pwd(); String pwd(List<String> workDir); ST_Loc getAbsTo(ST_Loc to); R get(ST_Loc loc, Function<Element, R> mapper); R get(String loc, Function<Element, R> mapper); Path getFile(ST_Loc stLoc); VirtualContainer getContainer(LinkedList<String> workDir); VirtualContainer getContainer(String containerPath); static Pattern PtDoc; static Pattern PtSigns; static Pattern PtSign; static Pattern PtPages; static Pattern PtPage; static Pattern PtPageRes; static Pattern PtDocRes; }### Answer:
@Test public void getAbsTo() throws IOException, DocumentException { try (OFDReader reader = new OFDReader(src)) { OFDDir ofdDir = reader.getOFDDir(); ResourceLocator rl = new ResourceLocator(ofdDir); rl.cd("/Doc_0"); Document document = rl.get("Document.xml", Document::new); ST_Loc pageLoc = document.getPages().getPageByIndex(0).getBaseLoc(); ST_Loc abs = rl.getAbsTo(pageLoc); assertEquals("/Doc_0/Pages/Page_0/Content.xml", abs.toString()); } }