### Question:
XarUtils { public static LocalDocumentReference getReference(File documentFile) throws XarException { try (FileInputStream stream = new FileInputStream(documentFile)) { return getReference(stream); } catch (FileNotFoundException e) { throw new XarException("Cannot find file", e); } catch (IOException e) { throw new XarException("Failed close file stream", e); } } private  XarUtils(); static LocalDocumentReference getReference(File documentFile); static LocalDocumentReference getReference(InputStream documentStream); static final RelativeStringEntityReferenceResolver RESOLVER; }### Answer:
@Test void getReference() throws XarException { LocalDocumentReference documentReference = new LocalDocumentReference("space.nestedspace", "page", Locale.ENGLISH); LocalDocumentReference nestedDocumentReference = new LocalDocumentReference(new EntityReference("page", EntityType.DOCUMENT, new EntityReference( "nestedspace", EntityType.SPACE, new EntityReference("space", EntityType.SPACE))), Locale.ENGLISH); assertEquals(nestedDocumentReference, XarUtils.getReference(getClass().getResourceAsStream("/document/document.xml"))); assertEquals(nestedDocumentReference, XarUtils.getReference(getClass().getResourceAsStream("/document/newdocument.xml"))); assertEquals(documentReference, XarUtils.getReference(getClass().getResourceAsStream("/document/legacydocument.xml"))); }