// Use same namespace URI but different prefixes
OMNamespace ns1 = factory.createOMNamespace("urn:ns", "p1");
OMNamespace ns2 = factory.createOMNamespace("urn:ns", "p2");
OMElement element = factory.createOMElement(new QName("test"));
OMAttribute att1 = factory.createOMAttribute("test", ns1, "test");
OMAttribute att2 = factory.createOMAttribute("test", ns2, "test");
element.addAttribute(att1);
element.addAttribute(att2);
Iterator it = element.getAllAttributes();
assertTrue(it.hasNext());
assertSame(att2, it.next());