Source:
public MockBoundedByteBufferReceive send(Send send) throws IOException { RequestOrResponseType type = ((RequestOrResponse) send).getRequestType(); switch (type) { case PutRequest: PutRequest putRequest = (PutRequest) send; final ServerErrorCode putError = hardError != null ? hardError : putErrors.size() > 0 ? putErrors.poll() : ServerErrorCode.No_Error; if (putError == ServerErrorCode.No_Error) { updateBlobMap(putRequest); } return new MockBoundedByteBufferReceive( new PutResponse(putRequest.getCorrelationId(), putRequest.getClientId(), putError) { ByteBuffer getPayload() throws IOException { ByteArrayOutputStream bStream = new ByteArrayOutputStream(); DataOutputStream dStream = new DataOutputStream(bStream); dStream.writeShort((short) RequestOrResponseType.PutResponse.ordinal()); dStream.writeShort(versionId); dStream.writeInt(correlationId); dStream.writeInt(0); dStream.writeShort((short) putError.ordinal()); return ByteBuffer.wrap(bStream.toByteArray()); } }.getPayload()); case DeleteRequest: if(!ifServerRespond) { return null; } final DeleteRequest deleteRequest = (DeleteRequest) send; final String blobIdString = deleteRequest.getBlobId().getID(); final ServerErrorCode error = getErrorFromBlobIdStr(blobIdString); return new MockBoundedByteBufferReceive( new PutResponse(deleteRequest.getCorrelationId(), deleteRequest.getClientId(), error) { ByteBuffer getPayload() throws IOException { ByteArrayOutputStream bStream = new ByteArrayOutputStream(); DataOutputStream dStream = new DataOutputStream(bStream); dStream.writeShort((short) RequestOrResponseType.DeleteResponse.ordinal()); dStream.writeShort(versionId); dStream.writeInt(correlationId); dStream.writeInt(0); dStream.writeShort((short) error.ordinal()); return ByteBuffer.wrap(bStream.toByteArray()); } }.getPayload()); default: throw new IOException("Unknown request type received"); } }

Target:
public MockBoundedByteBufferReceive send(Send send) throws IOException { RequestOrResponseType type = ((RequestOrResponse) send).getRequestType(); if (!shouldRespond) { return null; } switch (type) { case PutRequest: PutRequest putRequest = (PutRequest) send; final ServerErrorCode putError = hardError != null ? hardError : putErrors.size() > 0 ? putErrors.poll() : ServerErrorCode.No_Error; if (putError == ServerErrorCode.No_Error) { updateBlobMap(putRequest); } return new MockBoundedByteBufferReceive( new PutResponse(putRequest.getCorrelationId(), putRequest.getClientId(), putError) { ByteBuffer getPayload() throws IOException { ByteArrayOutputStream bStream = new ByteArrayOutputStream(); DataOutputStream dStream = new DataOutputStream(bStream); dStream.writeShort((short) RequestOrResponseType.PutResponse.ordinal()); dStream.writeShort(versionId); dStream.writeInt(correlationId); dStream.writeInt(0); dStream.writeShort((short) putError.ordinal()); return ByteBuffer.wrap(bStream.toByteArray()); } }.getPayload()); case DeleteRequest: final DeleteRequest deleteRequest = (DeleteRequest) send; final String blobIdString = deleteRequest.getBlobId().getID(); final ServerErrorCode error = getErrorFromBlobIdStr(blobIdString); return new MockBoundedByteBufferReceive( new DeleteResponse(deleteRequest.getCorrelationId(), deleteRequest.getClientId(), error) { ByteBuffer getPayload() throws IOException { ByteArrayOutputStream bStream = new ByteArrayOutputStream(); DataOutputStream dStream = new DataOutputStream(bStream); dStream.writeShort((short) RequestOrResponseType.DeleteResponse.ordinal()); dStream.writeShort(versionId); dStream.writeInt(correlationId); dStream.writeInt(0); dStream.writeShort((short) error.ordinal()); return ByteBuffer.wrap(bStream.toByteArray()); } }.getPayload()); default: throw new IOException("Unknown request type received"); } }