### Question:
FoxmlDocumentHelpers { public static Model getObjectModel(Document foxml) { Element relsContentEl = getDatastreamElByName(foxml, RELS_EXT_DS) .getChild("datastreamVersion", FOXML_NS) .getChild("xmlContent", FOXML_NS) .getChild("RDF", RDF_NS); Model model; try { model = createModel(convertRelsExtToStream(relsContentEl), "RDF/XML"); } catch (IOException e) { throw new RepositoryException("Failed to serialize RELS-EXT", e); } String foxmlPid = getFoxmlPid(foxml); String relsRescUri = "info:fedora/" + foxmlPid.toLowerCase(); Resource resc = model.getResource(relsRescUri); for (Element propEl : foxml.getRootElement().getChild("objectProperties", FOXML_NS).getChildren()) { String name = propEl.getAttributeValue("NAME"); String value = propEl.getAttributeValue("VALUE"); resc.addLiteral(createProperty(name), value); } return model; } private  FoxmlDocumentHelpers(); static Set<String> listDatastreams(Document foxml); static Model getObjectModel(Document foxml); static Element getDatastreamElByName(Document foxml, String name); static String getFoxmlPid(Document foxml); static InputStream convertRelsExtToStream(Element el); static List<DatastreamVersion> listDatastreamVersions(Document foxml, String name); static final String RELS_EXT_DS; static final String MODS_DS; static final String FITS_DS; static final String DC_DS; static final String PREMIS_DS; static final String MANIFEST_DS; static final String ORIGINAL_DS; }### Answer:
@Test public void getObjectModelForFolder() throws Exception { String objectId = "uuid:c9b95252-ca53-4e38-9155-81f3304ed3d5"; PID pid = PIDs.get(objectId); Document foxml = createSAXBuilder().build(getClass().getResource("/foxml/folderSmall.xml")); Model model = FoxmlDocumentHelpers.getObjectModel(foxml); Resource resultResc = model.getResource(toBxc3Uri(pid)); List<Statement> containsList = resultResc.listProperties(contains.getProperty()).toList(); assertEquals(6, containsList.size()); assertTrue(resultResc.hasProperty(hasModel.getProperty(), CONTAINER.getResource())); assertTrue(resultResc.hasProperty(hasModel.getProperty(), PRESERVEDOBJECT.getResource())); }