[Demonstration 1]

[Buggy Method]
@Security.Authenticated(Secured.class)
public static Result deleteImg(Long imgId, Long proId, String h) {
    User _user = User.findByUserId(Long.parseLong(session("userId")));
    if (!EditProject.canEditProject(_user, proId)) {
        flash("error", "access denied.");
        return redirect(routes.Application.index());
    }
    Project _project = Project.findById(proId);
    Image image = Image.findByIdAndPro(imgId, _project);
    int isDefault = image.getImgType();
    if (image != null) {
        image.delete();
        List<Image> imgs = Image.findImageOfProject(_project);
        if (isDefault == Image.DEFAULT) {
            imgs.get(0).setImgType(Image.DEFAULT);
            imgs.get(0).save();
        }
        flash("success", "Screenshot is deleted.");
    } else {
        flash("error", "Con't found Screenshot.");
    }
    return redirect(routes.EditProject.index(proId, h));
}

[Buggy Hunk]
if(isDefault == Image.DEFAULT){

[Patch]
if(isDefault == Image.DEFAULT && imgs.size() != 0){

[Demonstration 2]

[Buggy Method]
private void setGoogleMapOptions() {
    options.compassEnabled(true).rotateGesturesEnabled(true).zoomControlsEnabled(true);
    SupportMapFragment.newInstance(options);
}

[Buggy Hunk]
options.compassEnabled(true).rotateGesturesEnabled(true).zoomControlsEnabled(true);

[Patch]
options.compassEnabled(true).rotateGesturesEnabled(true).zoomControlsEnabled(true).ambientEnabled(true).tiltGesturesEnabled(true);

[Demonstration 3]

[Buggy Method]
private void setPrefsAndClient() {
    if (UtilityHelp.accountPrefs == null)
        UtilityHelp.accountPrefs = getSharedPreferences("thezacattacks.toottile.accounts", Context.MODE_PRIVATE);
    if (UtilityHelp.secretPrefs == null)
        UtilityHelp.secretPrefs = getSharedPreferences("thezacattacks.tootile.instance_secrets", Context.MODE_PRIVATE);
    if (UtilityHelp.client == null) {
        //TODO: for the love of god make this better
        chosenInstance = (String) accounts.keySet().toArray()[0];
        chosenAccount = (String) accounts.values().toArray()[0];
        UtilityHelp.client = new MastodonClient.Builder(chosenInstance.split("@")[1], new OkHttpClient.Builder(), new Gson()).accessToken(chosenAccount).build();
    }
}

[Buggy Hunk]
if (UtilityHelp.client == null) {

[Patch]
if (UtilityHelp.client == null && accountLoaded) {