[Demonstration 1]

[Buggy Method]
static String sendRequest(String url, String json) throws Exception {
    CloseableHttpClient httpclient = HttpClients.createDefault();
    try {
        HttpPost httpPost = new HttpPost(url);
        //Setting ContentType and Authorization
        httpPost.addHeader("Authorization", "Basic bmVvNGo6cGFzczEyMzQ=");
        httpPost.addHeader("content-type", "application/json");
        if (json != null || json != "") {
            StringEntity params = new StringEntity(json);
            //Setting POST content
            httpPost.setEntity(params);
        }
        // Create a custom response handler
        ResponseHandler<String> responseHandler = new ResponseHandler<String>() {

            public String handleResponse(final HttpResponse response) throws ClientProtocolException, IOException {
                int status = response.getStatusLine().getStatusCode();
                if (status >= 200 && status < 300) {
                    HttpEntity entity = response.getEntity();
                    return entity != null ? EntityUtils.toString(entity) : null;
                } else {
                    throw new ClientProtocolException(EntityUtils.toString(response.getEntity()));
                }
            }
        };
        return httpclient.execute(httpPost, responseHandler);
    } finally {
        httpclient.close();
        httpclient = null;
    }
}

[Buggy Hunk]
StringEntity params = new StringEntity(json);

[Patch]
StringEntity params = new StringEntity(json, "UTF-8");

[Demonstration 2]

[Buggy Method]
@Test
public void createWithName() throws Exception {
    Area area = new Area("Graz");
    assertEquals("Graz", area.getName());
}

[Buggy Hunk]
assertEquals("Graz", area.getName());

[Patch]
assertEquals("Name", "Graz", area.getName());

[Demonstration 3]

[Buggy Method]
@Override
public void onSaveInstanceState(Bundle outState) {
    if (mCurrentPiece != null) {
        Timber.d("onSaveInstanceState() " + mCurrentPiece.getTitle() + " by " + mCurrentComposer);
        Timber.d("..... Current Tempo: " + mCurrentTempo);
        outState.putString(CURRENT_PIECE_KEY, mCurrentPiece.getTitle());
        outState.putInt(CURRENT_TEMPO_KEY, mCurrentTempo);
        outState.putString(CURRENT_COMPOSER_KEY, mCurrentComposer);
    }
    super.onSaveInstanceState(outState);
}

[Buggy Hunk]
outState.putString(CURRENT_PIECE_KEY, mCurrentPiece.getTitle());

[Patch]
outState.putString(CURRENT_PIECE_TITLE_KEY, mCurrentPiece.getTitle());