MessagePropertiesElement { public static Collection<IProperty> readElement(final OMElement mpElement) { if (mpElement == null) return null; final ArrayList<IProperty> props = new ArrayList<>(); final Iterator<OMElement> it = PropertyElement.getElements(mpElement); while (it.hasNext()) props.add(PropertyElement.readElement((OMElement) it.next())); return props; }  static OMElement createElement(final OMElement umElement, final Collection<IProperty> properties); static OMElement getElement(final OMElement umElement); static Collection<IProperty> readElement(final OMElement mpElement); static final QName Q_ELEMENT_NAME; }
@Test public void testReadElement() throws Exception { Collection<IProperty> readProperties = MessagePropertiesElement.readElement(createXML( " <eb3:MessageProperties " + " xmlns:eb3=\"http: " <eb3:Property name=\"original-file-name\">simple_document.xml</eb3:Property>" + " <eb3:Property name=\"reference_number\">XREF_4828</eb3:Property>" + " </eb3:MessageProperties>")); assertNotNull(readProperties); assertEquals(2, readProperties.size()); }