[Demonstration 1]

[Buggy Method]
@Override
public void onSuccess(int statusCode, Header[] headers, JSONArray response) {
    if (statusCode == 200) {
        HashMap<Long, ArrayList<Tag>> taggings = new HashMap<Long, ArrayList<Tag>>();
        for (int i = 0; i < response.length(); ++i) {
            try {
                JSONObject taggingJson = response.getJSONObject(i);
                String taggableType = taggingJson.getString(taggingTaggableTypeKey);
                if (taggableType == "Topico") {
                    long tagId = taggingJson.getLong(taggingTagIdKey);
                    long proposalId = taggingJson.getLong(taggingTaggableIdKey);
                    Tag tag = dataContainer.getTagForId(tagId);
                    if (tag != null) {
                        ArrayList<Tag> tags;
                        if (taggings.containsKey(proposalId)) {
                            tags = taggings.get(proposalId);
                        } else {
                            tags = new ArrayList<Tag>();
                        }
                        tags.add(tag);
                        taggings.put(proposalId, tags);
                    } else {
                        /* Tag does not exist */
                    }
                } else {
                    /* Taggable is not a topic */
                }
            } catch (JSONException e) {
                e.printStackTrace();
            }
        }
        Set<Long> keySet = taggings.keySet();
        for (Long key : keySet) {
            Proposal proposal = dataContainer.getProposalForId(key);
            if (proposal != null) {
                proposal.setTags(taggings.get(key));
            } else {
                /* Proposal does not exist */
            }
        }
    }
}

[Buggy Hunk]
if (taggableType == "Topico") {

[Patch]
if (taggableType.equals("Topico")) {

[Demonstration 2]

[Buggy Method]
@Override
public void onResume() {
    super.onResume();
    // Check for changes to the preferences deciding which tabs to show and restart the activity if needed
    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
    if (prefs.getBoolean("numbers_show", true) != tabs[1] || prefs.getBoolean("lines_show", false) != tabs[2] || prefs.getBoolean("grid_show", false) != tabs[3] || prefs.getString("numbers_layout", "oneColumn") != layouts[0] || prefs.getString("lines_layout", "oneColumn") != layouts[1] || prefs.getString("grid_layout", "oneColumn") != layouts[2] || prefs.getString("numbers_size", "medium") != sizes[0] || prefs.getString("lines_size", "medium") != sizes[1] || prefs.getString("grid_size", "medium") != sizes[2]) {
        Intent intent = getIntent();
        finish();
        startActivity(intent);
    }
    ;
}

[Buggy Hunk]
prefs.getBoolean("grid_show", false) != tabs[3] ||

[Patch]
prefs.getBoolean("grid_show", true) != tabs[3] ||

[Demonstration 3]

[Buggy Method]
public void releaseAllDevices() throws DeviceNotFoundException {
    Set<Device> devicesToRelease = new HashSet<Device>(deviceToDescriptor.keySet());
    for (Device device : devicesToRelease) {
        releaseDevice(device);
    }
}

[Buggy Hunk]
Set<Device> devicesToRelease = new HashSet<Device>(deviceToDescriptor.keySet());

[Patch]
Set<Device> devicesToRelease = new HashSet<>(deviceToDescriptor.keySet());