ReceiptElement { public static Receipt readElement(final OMElement sigElement) { final Receipt rcptData = new Receipt(); MessageInfoElement.readElement(MessageInfoElement.getElement(sigElement), rcptData); rcptData.setContent(sigElement.getFirstChildWithName(Q_ELEMENT_NAME).getChildElements()); return rcptData; }  static OMElement createElement(final OMElement messaging, final IReceipt receipt); static Receipt readElement(final OMElement sigElement); static Iterator<OMElement> getElements(final SOAPHeaderBlock messaging); static final QName Q_ELEMENT_NAME; }
@Test public void testReadElement() throws Exception { Receipt receipt = new Receipt(); OMElement receiptChildElement = soapEnvelope.getOMFactory().createOMElement(RECEIPT_CHILD_ELEMENT_NAME); ArrayList<OMElement> content = new ArrayList<>(); content.add(receiptChildElement); receipt.setContent(content); OMElement rElement = ReceiptElement.createElement(headerBlock, receipt); receipt = ReceiptElement.readElement(rElement); assertEquals(RECEIPT_CHILD_ELEMENT_NAME, receipt.getContent().iterator().next().getQName()); }