[Demonstration 1]

[Buggy Method]
public String getBody() {
    return this.body;
}

[Buggy Hunk]
public String getBody(){

[Patch]
public byte[] getBody(){

[Demonstration 2]

[Buggy Method]
public void send(final String data) {
    final DataOutputStream dos = new DataOutputStream(out);
    if (!this._socket.isConnected()) {
        Log.e(TAG, "socket not connected");
        return;
    }
    try {
        final byte[] utf8 = data.getBytes("UTF-8");
        dos.writeInt(utf8.length);
        dos.write(utf8);
    } catch (final IOException e) {
        Log.e(TAG, "cannot write data to outputstream", e);
    }
    try {
        dos.flush();
        dos.close();
        this.out.flush();
    } catch (final IOException e) {
        Log.e(TAG, "cannot flush data to outputstream", e);
    }
}

[Buggy Hunk]
final DataOutputStream dos = new DataOutputStream(out);

[Patch]
final DataOutputStream dos = new DataOutputStream(new BufferedOutputStream(out));

[Demonstration 3]

[Buggy Method]
@Override
protected void doWriteTo(StreamOutput out) throws IOException {
    out.writeString(lookupIndex);
    out.writeString(lookupType);
    out.writeString(lookupId);
    out.writeOptionalString(lookupRouting);
    out.writeString(rootPath);
    out.writeString(idField);
    out.writeString(scoreField);
    out.writeInt(sortOrder.ordinal());
    subQuery.writeTo(out);
}

[Buggy Hunk]
subQuery.writeTo(out);

[Patch]
out.writeNamedWriteable(subQuery);