UserMessageElement { public static Iterator<OMElement> getElements(final OMElement messaging) { return messaging.getChildrenWithName(Q_ELEMENT_NAME); }  static OMElement createElement(final OMElement messaging, final IUserMessage data); static Iterator<OMElement> getElements(final OMElement messaging); static UserMessage readElement(final OMElement umElement); static final QName Q_ELEMENT_NAME; static final String LN_MPC_ATTR; }
@Test public void testGetElements() throws Exception { Iterator<OMElement> umElements = UserMessageElement.getElements(createXML( "<eb3:Messaging xmlns:eb3=\"http: " <eb3:UserMessage>\n" + " Normal contents of User Message would go here" + " </eb3:UserMessage>\n" + " <eb3:UserMessage>\n" + " Bundled User Message (NOTE: By default this is not allowed!" + " </eb3:UserMessage>\n" + "</eb3:Messaging>")); assertFalse(Utils.isNullOrEmpty(umElements)); assertEquals(USER_MESSAGE_ELEMENT_NAME, umElements.next().getQName()); assertTrue(umElements.hasNext()); assertEquals(USER_MESSAGE_ELEMENT_NAME, umElements.next().getQName()); assertFalse(umElements.hasNext()); }