[Demonstration 1]

[Buggy Method]
@Test
public void commandBox_nextCommand_exceedingIndex() {
    commandBox.runCommand(COMMAND_THAT_SUCCEEDS);
    commandBox.runCommand(ANOTHER_COMMAND_THAT_SUCCEEDS);
    commandBox.previousCommand();
    commandBox.previousCommand();
    commandBox.nextCommand();
    commandBox.nextCommand();
    commandBox.nextCommand();
    assertEquals(ANOTHER_COMMAND_THAT_SUCCEEDS, commandBox.getCommandInput());
}

[Buggy Hunk]
assertEquals(ANOTHER_COMMAND_THAT_SUCCEEDS, commandBox.getCommandInput());

[Patch]
assertEquals(FIRST_INDEXT_COMMAND_STRING, commandBox.getCommandInput());

[Demonstration 2]

[Buggy Method]
public static firm.Type varTypeFor(Type type) {
    if (type.isClass() || type.isArray()) {
        return firmReferenceFor(type);
    } else {
        assert (type.isPrimitive());
        return firmTypeFor(type);
    }
}

[Buggy Hunk]
assert(type.isPrimitive());

[Patch]
assert(type.isPrimitive() || type.isNull());

[Demonstration 3]

[Buggy Method]
private Command initEditCommand(ArrayList<String> parsedUserInput) {
    Command editCommandObject = new EditCommand(Command.Type.EDIT, storageComponent);
    editCommandObject.setCommandField(parsedUserInput.get(0));
    editCommandObject.setTaskName(parsedUserInput.get(1));
    switch(parsedUserInput.get(0)) {
        case ("set"):
            editCommandObject.setDescription(parsedUserInput.get(2));
            editCommandObject.setPriority(parsedUserInput.get(3));
            editCommandObject.setReminder(parsedUserInput.get(4));
            editCommandObject.setCategory(parsedUserInput.get(5));
            break;
        case ("setT"):
            editCommandObject.setDescription(parsedUserInput.get(2));
            editCommandObject.setEndDateAndTime(parsedUserInput.get(3));
            editCommandObject.setPriority(parsedUserInput.get(4));
            editCommandObject.setReminder(parsedUserInput.get(5));
            editCommandObject.setCategory(parsedUserInput.get(6));
            break;
        case ("setE"):
            editCommandObject.setDescription(parsedUserInput.get(2));
            editCommandObject.setStartDateAndTime(parsedUserInput.get(3));
            //				System.out.println("setE StartTime/Date: "+ parsedUserInput.get(3));
            editCommandObject.setEndDateAndTime(parsedUserInput.get(4));
            //				System.out.println("setE EndTime/Date: "+ parsedUserInput.get(4));
            editCommandObject.setPriority(parsedUserInput.get(5));
            editCommandObject.setReminder(parsedUserInput.get(6));
            editCommandObject.setCategory(parsedUserInput.get(7));
            break;
        case ("deadline"):
            editCommandObject.setEndDateAndTime(parsedUserInput.get(2));
            break;
        case ("event"):
            editCommandObject.setStartDateAndTime(parsedUserInput.get(2));
            editCommandObject.setEndDateAndTime(parsedUserInput.get(3));
            break;
        case ("description"):
            editCommandObject.setDescription(parsedUserInput.get(2));
            break;
        case ("reminder"):
            editCommandObject.setReminder(parsedUserInput.get(2));
            break;
        case ("setcat"):
            editCommandObject.setCategory(parsedUserInput.get(2));
            break;
        case ("priority"):
            editCommandObject.setPriority(parsedUserInput.get(2));
    }
    return editCommandObject;
}

[Buggy Hunk]
Command editCommandObject = new EditCommand(Command.Type.EDIT,storageComponent);

[Patch]
Command editCommandObject = new EditCommand(Command.Type.EDIT,storageComponent,historySubComponent);