### Question:
ResponderImpl implements Responder { public void sendMSSyncMultipartResponse(String defaultNamespace, Document doc, Collection<byte[]> files, boolean gzip) { Preconditions.checkNotNull(defaultNamespace); Preconditions.checkNotNull(doc); Preconditions.checkNotNull(files); resp.setContentType("application/vnd.ms-sync.multipart"); try (OutputStream out = getOutputStream(gzip)) { byte[] wbxml = wbxmlTools.toWbxml(defaultNamespace, doc); List<byte[]> fileByte = constructByteArraysList(files, wbxml); int nbDoc = fileByte.size(); int fileStart = 0; fileStart += writeNbParts(out, nbDoc); fileStart = writePartsOffsets(out, fileByte, nbDoc, fileStart); writeByteArrays(out, fileByte); } catch (IOException e) { logger.warn(e.getMessage(), e); } catch (WBXmlException e) { logger.error(e.getMessage(), e); } } ResponderImpl(String contentType, HttpServletResponse resp, IntEncoder intEncoder, WBXMLTools wbxmlTools, 
			DOMDumper domDumper); @Override void sendWBXMLResponse(String defaultNamespace, Document doc); @Override void sendXMLResponse(String defaultNamespace, Document doc); @Override void sendResponseFile(String contentType, InputStream file); void sendMSSyncMultipartResponse(String defaultNamespace,
			Document doc, Collection<byte[]> files, boolean gzip); @Override void sendError(int statusCode); @Override void sendNoChangeResponse();  }### Answer:
@Test public void sendMSSyncMultipartResponse() throws IOException, WBXmlException { String namespace = "myNS"; byte[] textData = {4, 3, 2, 1}; byte[] binaryPart = {1, 2, 3}; HttpServletResponse servletResponse = EasyMock.createMock(HttpServletResponse.class); ServletOutputStream servletOutputStream = EasyMock.createMock(ServletOutputStream.class); IntEncoder intEncoder = EasyMock.createMock(IntEncoder.class); WBXMLTools wbxmlTools = EasyMock.createMock(WBXMLTools.class); Document document = EasyMock.createMock(Document.class); DOMDumper domDumper = EasyMock.createMock(DOMDumper.class); servletResponse.setContentType("application/vnd.ms-sync.multipart"); EasyMock.expect(servletResponse.getOutputStream()).andReturn(servletOutputStream); EasyMock.expect(wbxmlTools.toWbxml(namespace, document)).andReturn(textData); writeInt(servletOutputStream, intEncoder, (byte) 2); writeInt(servletOutputStream, intEncoder, (byte) 20); writeInt(servletOutputStream, intEncoder, (byte) 4); writeInt(servletOutputStream, intEncoder, (byte) 24); writeInt(servletOutputStream, intEncoder, (byte) 3); servletOutputStream.write(textData); servletOutputStream.write(binaryPart); servletOutputStream.close(); EasyMock.replay(servletResponse, intEncoder, wbxmlTools, document); ResponderImpl responder = new ResponderImpl("unused content type", servletResponse, intEncoder, wbxmlTools, domDumper); responder.sendMSSyncMultipartResponse(namespace, document, Arrays.asList(binaryPart), false); EasyMock.verify(servletResponse, intEncoder, wbxmlTools, document); }