[Demonstration 1]

[Buggy Method]
public boolean isEditValid(String[] arguments) {
    if (arguments.length == 0 || arguments.length == 1) {
        return false;
    }
    if (!isInteger(arguments[0])) {
        return false;
    }
    for (int i = 1; i < arguments.length; i += 2) {
        if (!!commandList_.getEditArgumentList().contains(arguments[i])) {
            return false;
        } else {
            if (i + 1 == arguments.length) {
                return false;
            } else if (arguments[i].equals("date")) {
                String date = naturalDate_.getDate(arguments[i + 1]);
                if (date == null) {
                    invalidDate = true;
                    return false;
                } else {
                    arguments[i + 1] = date;
                }
            } else if (arguments[i].equals("start") || arguments[i].equals("end")) {
                String time = naturalTime_.getTime(arguments[i + 1]);
                if (time == null) {
                    invalidTime = true;
                    return false;
                } else {
                    arguments[i + 1] = time;
                }
            }
        }
    }
    return true;
}

[Buggy Hunk]
if (!!commandList_.getEditArgumentList().contains(arguments[i])) {

[Patch]
if (!commandList_.getEditArgumentList().contains(arguments[i])) {

[Demonstration 2]

[Buggy Method]
@Get("json")
public Student loginStudent() {
    if (!RestApp.getInstance().authenticate(getRequest(), getResponse())) {
        throw new NotAuthorizedException();
    }
    String email = "";
    try {
        email = getAttribute("email");
    } catch (Exception e) {
        throw new GenericException("Please provide an email!");
    }
    return ss.getStudent(email);
}

[Buggy Hunk]
email = getAttribute("email");

[Patch]
email = getQueryValue("email");

[Demonstration 3]

[Buggy Method]
double calculatePrice() {
    double final_price = basePrice * quantity * 1.1;
    double shipping_price = 20 * weight * quantity;
    final_price = roundCents(final_price + shipping_price);
    return final_price;
}

[Buggy Hunk]
double final_price = basePrice * quantity * 1.1;

[Patch]
double final_price = basePrice * quantity * salesTax;