### Question:
BinaryRelayBuilder implements Builder { public OMElement processDocument(InputStream inputStream, String contentType, MessageContext messageContext) throws AxisFault { try { messageContext.setProperty(Constants.Configuration.CONTENT_TYPE, contentType); SOAPFactory factory = OMAbstractFactory.getSOAP12Factory(); SOAPEnvelope env = factory.getDefaultEnvelope(); if (inputStream != null) { OMNamespace ns = factory.createOMNamespace( RelayConstants.BINARY_CONTENT_QNAME.getNamespaceURI(), "ns"); OMElement omEle = factory.createOMElement( RelayConstants.BINARY_CONTENT_QNAME.getLocalPart(), ns); StreamingOnRequestDataSource ds = new StreamingOnRequestDataSource(inputStream); DataHandler dataHandler = new DataHandler(ds); OMText textData = factory.createOMText(dataHandler, true); omEle.addChild(textData); env.getBody().addChild(omEle); } return env; } catch (SOAPProcessingException e) { throw AxisFault.makeFault(e); } catch (OMException e) { throw AxisFault.makeFault(e); } }  static byte[] readAllFromInputSteam(InputStream in); OMElement processDocument(InputStream inputStream,
			String contentType, MessageContext messageContext);  }### Answer:
@Test public void testProcessDocument() throws Exception{ InputStream in = new ByteArrayInputStream("testString".getBytes()); String contentType = "application/xml"; MessageContext messageContext = new MessageContext(); BinaryRelayBuilder builder = new BinaryRelayBuilder(); OMElement response = builder.processDocument(in, contentType, messageContext); String expected = "<?xml version='1.0' encoding='utf-8'?>"+ "<soapenv:Envelope xmlns:soapenv=\"http: "<soapenv:Body><ns:binary xmlns:ns=\"http: "</soapenv:Body></soapenv:Envelope>"; Assert.assertEquals("Couldn't create OMElement!", expected, response.toString()); }