ZFrame { public ZFrame duplicate() { int length = size(); byte[] copy = new byte[length]; System.arraycopy(this.data, 0, copy, 0, length); ZFrame frame = new ZFrame(); frame.data = copy; if (this.buffer != null) { frame.buffer = this.buffer.duplicate(); } frame.more = this.more; return frame; } ZFrame();  ZFrame(final byte[] data);  ZFrame(final ByteBuffer buffer);  ZFrame(String data); int capacity(); void destroy(); byte[] getData(); boolean hasMore(); int size(); boolean hasData(); boolean send(Socket socket, int flags); ZFrame duplicate(); void reset(byte[] data); void reset(String data); String strhex(); boolean streq(String str); @Override boolean equals(Object o); @Override int hashCode(); String toString(); static ZFrame recvFrame(Socket socket); static ZFrame recvFrame(Socket socket, int flags);  }
@Test public void testZFrameEquals() { ZFrame f = new ZFrame("Hello".getBytes()); ZFrame clone = f.duplicate(); assertEquals(f, clone); }