FragmentBuilder { public void writeInData(int hashCode, byte[] b, int offset, int len) { if (inStream != null && (hashCode == -1 || hashCode == inHashCode)) { inStream.write(b, offset, len); } }  boolean isComplete(); boolean isCompleteExceptIgnoredNodes(); Trace getTrace(); ReportingLevel getLevel(); void setLevel(ReportingLevel level); Node getCurrentNode(); Node getLatestNode(String nodeType, boolean onStack); void pushNode(Node node); Node popNode(Class<? extends Node> cls, String uri); void retainNode(String id); Node releaseNode(String id); Node retrieveNode(String id); void addUncompletedCorrelationId(String id, Node node, int position); Set<String> getUncompletedCorrelationIds(); int getUncompletedCorrelationIdPosition(String id); Node removeUncompletedCorrelationId(String id); void suppress(); boolean isSuppressed(); void ignoreNode(); void initInBuffer(int hashCode); boolean isInBufferActive(int hashCode); void writeInData(int hashCode, byte[] b, int offset, int len); byte[] getInData(int hashCode); void initOutBuffer(int hashCode); boolean isOutBufferActive(int hashCode); void writeOutData(int hashCode, byte[] b, int offset, int len); byte[] getOutData(int hashCode); void setState(Object context, String name, Object value); Object getState(Object context, String name); int getThreadCount(); @Override String toString();  }
@Test public void testWriteInData() { FragmentBuilder builder = new FragmentBuilder(); builder.initInBuffer(1); String data1 = "Hello "; builder.writeInData(1, data1.getBytes(), 0, data1.length()); String data2 = "World"; builder.writeInData(1, data2.getBytes(), 0, data2.length()); assertTrue(builder.isInBufferActive(1)); assertEquals("Hello World", new String(builder.getInData(1))); assertFalse(builder.isInBufferActive(1)); }