[Demonstration 1]

[Buggy Method]
private void runTask(CountDownLatch latch, W4QueueTask task, W4QueueTaskPromise taskPromise) {
    final W4ParsePromise internalPromise = task.getTaskPromise();
    W4ParsePromise parsePromise = (list) -> {
        Integer idx = this.index.get(task.hashCode());
        if (idx != null) {
            this.result.addResult(idx, list);
            if (this.progressPromise != null) {
                this.progressPromise.onProgress(task, list);
            }
            latch.countDown();
        }
        if (internalPromise != null) {
            internalPromise.complete(list);
        }
        taskPromise.taskCompleted();
    };
    task.setTaskPromise(parsePromise);
    task.run();
}

[Buggy Hunk]
W4ParsePromise parsePromise = (list) -> {

[Patch]
W4ParsePromise<List> parsePromise = (list) -> {

[Demonstration 2]

[Buggy Method]
public void addStudent() {
    TextInputDialog dialog = new TextInputDialog("");
    dialog.setTitle("Add Student");
    dialog.setHeaderText("");
    dialog.setContentText("Name:");
    Optional<String> result = dialog.showAndWait();
    if (result.isPresent()) {
        if (currentSection.findStudent(result.get()) != null) {
            Alert invalidNameAlert = new Alert(Alert.AlertType.INFORMATION);
            invalidNameAlert.setTitle("Invalid Student Name");
            invalidNameAlert.setHeaderText(null);
            invalidNameAlert.setContentText("You cannot have two students with the same name. Please enter an unused student name or add a '#1' or '#2'");
            invalidNameAlert.showAndWait();
            addStudent();
        } else {
            currentSection.addStudent(new Student(currentSection, result.get()));
        }
        updateTable();
    }
}

[Buggy Hunk]
if(currentSection.findStudent(result.get()) != null){

[Patch]
if(currentSection.getNames().indexOf(result.get()) != -1){

[Demonstration 3]

[Buggy Method]
public boolean isShown() {
    View current = this;
    //noinspection ConstantConditions
    do {
        String appName = mContext.getPackageName();
        if (WindowManagerGlobal.isActiveEvenInBackground(appName)) {
        } else if ((current.mViewFlags & VISIBILITY_MASK) != VISIBLE) {
            return false;
        }
        ViewParent parent = current.mParent;
        if (parent == null) {
            // We are not attached to the view root
            return false;
        }
        if (!(parent instanceof View)) {
            return true;
        }
        current = (View) parent;
    } while (current != null);
    return false;
}

[Buggy Hunk]
if (WindowManagerGlobal.isActiveEvenInBackground(appName)) {

[Patch]
if (isActiveInBackground) {