[Demonstration 1]

[Buggy Method]
void getData(ArrayList<Map<String, Object>> items) {
    items.clear();
    for (String item : ModelManager.getInstance().getTags()) {
        Map<String, Object> lstitem = new HashMap<String, Object>();
        if (_tag != null && _tag.contains(item.trim())) {
            lstitem.put(checkKey, true);
        } else {
            lstitem.put(checkKey, false);
        }
        lstitem.put(nameKey, item.trim());
        items.add(lstitem);
    }
}

[Buggy Hunk]
if(_tag != null && _tag.contains(item.trim())){

[Patch]
if(m_tag != null && m_tag.contains(item.trim())){

[Demonstration 2]

[Buggy Method]
@Override
protected void updateItem(Pair<Integer, Task> item, boolean empty) {
    super.updateItem(item, empty);
    if (empty) {
        this.setGraphic(null);
    } else {
        int index = item.getKey();
        Task task = item.getValue();
        // Grey out completed tasks
        if (task.isCompleted()) {
            this.getStyleClass().add("completed");
        }
        // Take care of priority
        if (task.getPriority() != null) {
            this.getStyleClass().add("priority--" + task.getPriority().name().toLowerCase());
        }
        this._indexLabel.setText(Integer.toString(index));
        this._nameLabel.setText(task.getTaskName());
        //set animation for newly added task
        if (this._lastCommand.getInstruction() == Command.Instruction.ADD && item.getKey() == this._newTaskIndex) {
            setHighlightAnimation();
        }
        // Optional date time to support floating tasks
        this._dateLabel.setText(_df.getPairDateDisplay(task.getStartTime(), task.getEndTime()));
        this.setGraphic(this._container);
    }
}

[Buggy Hunk]
if(this._lastCommand.getInstruction() == Command.Instruction.ADD && item.getKey() == this._newTaskIndex) {

[Patch]
if(this._lastCommand.getInstruction() == Command.Instruction.ADD && item.getKey() == (this._newTaskIndex +1)) {

[Demonstration 3]

[Buggy Method]
public boolean isSameTask(ReadOnlyTask task) {
    return getTitle().equals(task.getTitle().fullTitle) && getDescription().equals(task.getDescription().fullDescription) && getStartDate().equals(task.getStartDate().startDate.toString()) && getDueDate().equals(task.getDueDate().dueDate.toString()) && getInterval().equals(task.getInterval().value) && getTimeInterval().equals(task.getTimeInterval().value);
}

[Buggy Hunk]
&& getInterval().equals(task.getInterval().value) && getTimeInterval().equals(task.getTimeInterval().value);

[Patch]
&& getInterval().equals(task.getInterval().value) && getTimeInterval().equals(task.getTimeInterval().value) && getStatus().equals(task.getStatus().toString());