[Demonstration 1]

[Buggy Method]
private Object webInvoke(String method, String url, Map<String, Object> data, String contentType, boolean responseInputStream) throws EmotionServiceException {
    HttpPost request = null;
    request = new HttpPost(url);
    boolean isStream = false;
    /*Set header*/
    if (contentType != null && !contentType.isEmpty()) {
        request.setHeader("Content-Type", contentType);
        if (contentType.toLowerCase().contains("octet-stream")) {
            isStream = true;
        }
    } else {
        request.setHeader("Content-Type", "application/json");
    }
    request.setHeader(headerKey, this.subscriptionKey);
    try {
        if (!isStream) {
            String json = this.gson.toJson(data).toString();
            StringEntity entity = new StringEntity(json);
            request.setEntity(entity);
        } else {
            request.setEntity(new ByteArrayEntity((byte[]) data.get("data")));
        }
        HttpResponse response = this.client.execute(request);
        int statusCode = response.getStatusLine().getStatusCode();
        if (statusCode == 200) {
            if (!responseInputStream) {
                return readInput(response.getEntity().getContent());
            } else {
                return response.getEntity().getContent();
            }
        } else {
            throw new Exception("Error executing POST request! Received error code: " + response.getStatusLine().getStatusCode());
        }
    } catch (Exception e) {
        throw new EmotionServiceException(e.getMessage());
    }
}

[Buggy Hunk]
if (contentType.toLowerCase().contains("octet-stream")) {

[Patch]
if (contentType.toLowerCase(Locale.ENGLISH).contains("octet-stream")) {

[Demonstration 2]

[Buggy Method]
final protected void setContentType(String contentType) {
    this.contentType = contentType;
    resp.setContentType(contentType);
}

[Buggy Hunk]
final protected void setContentType(String contentType) {

[Patch]
final public void setContentType(String contentType) {

[Demonstration 3]

[Buggy Method]
@Override
public String apply(ValidationError input) {
    return input.getMessageTemplate() + " " + input.getPath() + " " + input.getMessage();
}

[Buggy Hunk]
return input.getMessageTemplate() + " " + input.getPath() + " " + input.getMessage();

[Patch]
return input.getPath() + " " + input.getMessage();