[Demonstration 1]

[Buggy Method]
@AfterMethod
public void sleep() throws InterruptedException {
    Thread.sleep(1000);
}

[Buggy Hunk]
public void sleep() throws InterruptedException {

[Patch]
void sleep() throws InterruptedException {

[Demonstration 2]

[Buggy Method]
@Override
public void run() {
    //this is what combines the threads. "this refers to it being the child process"
    synchronized (this) {
        System.out.println("im here");
        //notify();
        try {
            Thread.sleep(100);
        } catch (InterruptedException e3) {
            // TODO Auto-generated catch block
            e3.printStackTrace();
        }
        try {
            System.out.println("Locked!");
            //notify();
            wait();
            System.out.println("Freed!");
        } catch (InterruptedException e2) {
            // TODO Auto-generated catch block
            e2.printStackTrace();
        }
        //this is an infinite loop to keep checking for updates
        while (true) {
            try {
                Thread.sleep(200);
            } catch (InterruptedException e1) {
                // TODO Auto-generated catch block
                e1.printStackTrace();
            }
            //check to see if the global was clicked(something was clicked/flagged)
            //System.out.println(selectedTerritory);
            if (selectedTerritory != -1) {
                System.out.println("aGlobal: " + selectedTerritory);
                //notify the parent that something was clicked
                notify();
                System.out.println("waiting inner...");
                //wait for parent to respond with notify
                try {
                    wait();
                } catch (InterruptedException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
            //System.out.println("beep..."+aGlobalClicked);
        }
    }
}

[Buggy Hunk]
if(selectedTerritory!=-1){

[Patch]
if(selectedTerritory!=-1||nextPhase){

[Demonstration 3]

[Buggy Method]
static ContentValues createTrailerValues(long id) {
    ContentValues favoriteValues = new ContentValues();
    favoriteValues.put(MovieContract.TrailerEntry.COLUMN_DESCRIPTION, "Some description");
    favoriteValues.put(MovieContract.TrailerEntry.COLUMN_FAVORITE_ID, 1);
    favoriteValues.put(MovieContract.TrailerEntry.COLUMN_URI, "some uri");
    return favoriteValues;
}

[Buggy Hunk]
favoriteValues.put(MovieContract.TrailerEntry.COLUMN_FAVORITE_ID, 1);

[Patch]
favoriteValues.put(MovieContract.TrailerEntry.COLUMN_FAVORITE_ID, id);