ReceiptElement { public static OMElement createElement(final OMElement messaging, final IReceipt receipt) { final OMElement signalmessage = SignalMessageElement.createElement(messaging); MessageInfoElement.createElement(signalmessage, receipt); final OMElement rcptElement = signalmessage.getOMFactory().createOMElement(Q_ELEMENT_NAME, signalmessage); for(final OMElement e : receipt.getContent()) rcptElement.addChild(e); return signalmessage; }  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 testCreateElement() 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); assertEquals(SIGNAL_MESSAGE_ELEMENT_NAME, rElement.getQName()); }