ProviderImpl impl = new ProviderImpl();
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Element element = builder.newDocument().createElement("customMetadata");
List<Element> metadata = new ArrayList<Element>();
metadata.add(element);
W3CEndpointReference w3Epr = impl.createW3CEndpointReference(
"http://myaddress", null, null,
metadata, null, null);
java.io.StringWriter sw = new java.io.StringWriter();
StreamResult result = new StreamResult(sw);
w3Epr.writeTo(result);
assertTrue("Address is expected", sw.toString().contains("Address"));
assertTrue("Metadata element expected", sw.toString().contains("Metadata"));
assertTrue("Custom Metadata element expected", sw.toString().contains("customMetadata"));
assertFalse("Interface element unexpected", sw.toString().contains("Interface"));
assertFalse("ServiceName unexpected", sw.toString().contains("ServiceName"));