final Connection conn = EasyMock.createMock(Connection.class);
EasyMock.expect(conn.getRemoteSocketAddress()).andReturn(new InetSocketAddress(8181)).anyTimes();
final int opaque = 99;
final IoBuffer head = IoBuffer.wrap(("value " + 2 * str.length() + " " + opaque + "\r\n").getBytes());
conn.transferFrom(head, null, this.fileMessageSet.channel(), 0, 2 * str.length());
EasyMock.expectLastCall();
EasyMock.replay(conn);
subSet.write(new GetCommand("test", "boyan-test", -1, 0, 1024 * 1024, opaque), new SessionContextImpl(null,
conn));