[Demonstration 1]

[Buggy Method]
private Set<Coords> getEmptyIntersections() {
    Set<Coords> emptyIntersections = getAllIntersections();
    emptyIntersections.removeAll(getLiveBlackStones());
    emptyIntersections.removeAll(getLiveWhiteStones());
    return emptyIntersections;
}

[Buggy Hunk]
private Set<Coords> getEmptyIntersections() {

[Patch]
protected Set<Coords> getEmptyIntersections() {

[Demonstration 2]

[Buggy Method]
public static Path getActualDeploymentModel(String ipMpl, VirtualMachine mpl, VirtualMachine app, String cloudMl, String loadBalancer, boolean remotePathIfNecessary) throws Exception {
    String body = FileUtils.readFileToString(Configuration.getPathToFile(cloudMl).toFile());
    JSONObject jsonObject = new JSONObject(body);
    Date date = new Date();
    String now = String.format("%1$td%1$tm%1$ty%1$tH%1$tM", date);
    if (jsonObject.has("providers")) {
        JSONArray array = jsonObject.getJSONArray("providers");
        for (int i = 0; i < array.length(); ++i) {
            JSONObject provider = array.getJSONObject(i);
            if (provider.has("credentials")) {
                String credentials = provider.getString("credentials");
                String s = null;
                if (remotePathIfNecessary)
                    s = Test.getActualFile(ipMpl, mpl, credentials, now);
                else
                    s = Configuration.getPathToFile(credentials).toString();
                provider.put("credentials", s);
                body = body.replaceAll(credentials, s);
            }
        }
    }
    if (jsonObject.has("vms")) {
        JSONArray array = jsonObject.getJSONArray("vms");
        for (int i = 0; i < array.length(); ++i) {
            JSONObject vmo = array.getJSONObject(i);
            if (vmo.has("privateKey")) {
                String privateKey = vmo.getString("privateKey");
                String s = null;
                if (remotePathIfNecessary)
                    s = Test.getActualKey(ipMpl, mpl, privateKey, now);
                else
                    s = Configuration.getPathToFile(privateKey).toString();
                vmo.put("privateKey", s);
                body = body.replaceAll(privateKey, s);
            }
        }
    }
    body = String.format(body, RandomStringUtils.randomNumeric(3), app.getImageId(), it.cloud.amazon.Configuration.REGION, String.format(app.getParameter("STARTER").replaceAll("&&", " ; "), ipMpl), String.format(app.getParameter("ADD_TO_LOAD_BALANCER").replaceAll("&&", " ; "), it.cloud.amazon.Configuration.AWS_CREDENTIALS.getAWSAccessKeyId(), it.cloud.amazon.Configuration.AWS_CREDENTIALS.getAWSSecretKey(), it.cloud.amazon.Configuration.REGION, loadBalancer), String.format(app.getParameter("DEL_FROM_LOAD_BALANCER").replaceAll("&&", " ; "), it.cloud.amazon.Configuration.AWS_CREDENTIALS.getAWSAccessKeyId(), it.cloud.amazon.Configuration.AWS_CREDENTIALS.getAWSSecretKey(), it.cloud.amazon.Configuration.REGION, loadBalancer), app.getSize());
    Path p = Files.createTempFile("model", ".json");
    FileUtils.writeStringToFile(p.toFile(), body);
    return p;
}

[Buggy Hunk]
app.getParameter("STARTER").replaceAll("&&", " ; "),

[Patch]
getWholeListOfParameters(app, "STARTER", " && ").replaceAll("&&", " ; "),

[Demonstration 3]

[Buggy Method]
@FXML
private void handleRegisterButtonAction(ActionEvent event) {
    resetErrors();
    String fullname = fullnameRegField.getText();
    String username = usernameRegField.getText();
    String email = emailRegField.getText();
    UserLevel userLevel = accountTypeRegBox.getValue();
    String password = pwRegField.getText();
    String passwordConf = pwConfRegField.getText();
    Debug.debug("Attempting to register user: username: \"%s\"; fullname: \"%s\"; email: \"%s\"; password: \"%s\"; passwordConf: \"%s\"; type: \"%s\"", username, fullname, email, password, passwordConf, userLevel.toString());
    if (fullname.length() == 0) {
        Debug.debug("Fullname field cannot be left blank!");
        fullnameRegErrorLabel.setText("Fullname cannot be left blank!");
    } else if (username.length() == 0) {
        Debug.debug("Username field cannot be left blank!");
        usernameRegErrorLabel.setText("Username cannot be left blank!");
    } else if (email.length() == 0) {
        Debug.debug("email field cannot be left blank!");
        emailRegErrorLabel.setText("Email cannot be left blank!");
    } else if (password.length() == 0) {
        Debug.debug("Password field cannot be left blank!");
        pwRegErrorLabel.setText("Password cannot be left blank!");
    } else if (passwordConf.length() == 0) {
        Debug.debug("Password confirmation field cannot be left blank!");
        pwConfRegErrorLabel.setText("Password confirmation cannot be left blank!");
    } else {
        if (!password.equals(passwordConf)) {
            Debug.debug("Password and password confirmation do not match!");
            pwConfRegErrorLabel.setText("Passwords do not match!");
        } else {
            Debug.debug("User registration successful!");
            newReg = UserManager.register(username, fullname, email, password, userLevel);
            if (newReg != null) {
                registered = true;
                stage.close();
                return;
            }
            Debug.debug("Username already taken!");
            usernameRegErrorLabel.setText("Username already taken!");
        }
    }
    Debug.debug("User registration failed!");
}

[Buggy Hunk]
newReg = UserManager.register(username, fullname, email, password, userLevel);

[Patch]
newReg = UserManager.register(username, password, fullname, email, userLevel);