### Question:
BPMN2ModelUtil { public static TDefinitions deserialize(java.io.InputStream is) throws IOException { TDefinitions ret=null; try { JAXBContext context = JAXBContext.newInstance("org.savara.bpmn2.model", BPMN2ModelUtil.class.getClassLoader()); Unmarshaller unmarshaller = context.createUnmarshaller(); Object xmlObject = unmarshaller.unmarshal(is); if (xmlObject instanceof JAXBElement) { ret = (TDefinitions)((JAXBElement<?>)xmlObject).getValue(); } } catch(Exception e) { throw new IOException("Failed to deserialize BPMN2 definitions", e); } return(ret); }  static TDefinitions deserialize(java.io.InputStream is); static void serialize(TDefinitions defns, java.io.OutputStream os); static void serialize(TDefinitions defns, java.io.OutputStream os,
					java.lang.ClassLoader classLoader);  }### Answer:
@Test public void testGetDefinitions() { java.io.InputStream is= ClassLoader.getSystemResourceAsStream("testmodels/bpmn2/choreo/PurchaseGoods.bpmn"); try { org.savara.bpmn2.model.TDefinitions defns=BPMN2ModelUtil.deserialize(is); if (defns == null) { fail("No definitions returned"); } boolean f_choreoFound=false; for (JAXBElement<? extends TRootElement> elem : defns.getRootElement()) { if (elem.getDeclaredType() == TChoreography.class) { if (f_choreoFound) { fail("Should only be one choreography"); } f_choreoFound = true; } else if (elem.getDeclaredType() == TItemDefinition.class) { TItemDefinition itemdefn=(TItemDefinition)elem.getValue(); if (itemdefn.getStructureRef() == null) { fail("Item definition structure ref is null"); } } } if (f_choreoFound == false) { fail("Choreography not found"); } } catch(Exception e) { e.printStackTrace(); fail("Failed to load BPMN2 definition: "+e); } }