@Test
public void testCreateElementWithRefTo() throws Exception {

    // Receipt with RefToMessageId
    Receipt receipt = new Receipt();
    receipt.setMessageId(UUID.randomUUID().toString());
    receipt.setTimestamp(new Date());
    receipt.setRefToMessageId(UUID.randomUUID().toString());
	OMElement miElement = MessageInfoElement.createElement(createParent(), receipt);
	
	assertNotNull(miElement);
	assertEquals(MESSAGE_INFO_ELEMENT_NAME, miElement.getQName());
	
	Iterator<OMElement> msgIdElems = miElement.getChildrenWithName(MESSAGE_ID_ELEMENT_NAME);
	assertFalse(Utils.isNullOrEmpty(msgIdElems));
	assertEquals(receipt.getMessageId(), msgIdElems.next().getText());
	Iterator<OMElement> timestampElems = miElement.getChildrenWithName(TIMESTAMP_ELEMENT_NAME);
	assertFalse(Utils.isNullOrEmpty(timestampElems));    	
	assertEquals(Utils.toXMLDateTime(receipt.getTimestamp()), timestampElems.next().getText());
	Iterator<OMElement> refToElems = miElement.getChildrenWithName(REF_TO_MESSAGE_ID_ELEMENT_NAME);
	assertFalse(Utils.isNullOrEmpty(refToElems));    	
	assertEquals(receipt.getRefToMessageId(), refToElems.next().getText());
}