[Demonstration 1]

[Buggy Method]
private void add(E element, NodeBinTree<E> root) {
    NodeBinTree<E> nextNode;
    int comp = element.compareTo(root.getElement());
    switch(comp) {
        case -1:
            nextNode = root.getLeftChild();
            break;
        case 1:
            nextNode = root.getRightChild();
            break;
        default:
            nextNode = null;
            break;
    }
    if (null != nextNode) {
        add(element, nextNode);
    } else if (comp == -1) {
        nextNode = new NodeBinTree<E>(element, root);
        root.setLeftChild(nextNode);
    } else {
        nextNode = new NodeBinTree<E>(element, root, root.getRightChild());
        root.setRightChild(nextNode);
    }
}

[Buggy Hunk]
nextNode = new NodeBinTree<E>(element, root, root.getRightChild());

[Patch]
nextNode = new NodeBinTree<E>(element, root, null, root.getRightChild());

[Demonstration 2]

[Buggy Method]
ArrayList<String> getUser(int id) {
    Cursor mCursor = db.query(DATABASE_TABLE, new String[] { KEY_ROWID, KEY_USERNAME, KEY_AGE, KEY_GENDER }, KEY_ROWID + "=?", new String[] { String.valueOf(id) }, null, null, null);
    if (mCursor != null) {
        mCursor.moveToFirst();
    }
    int userId = Integer.parseInt(mCursor.getString(0));
    String userName = mCursor.getString(1);
    String userAge = mCursor.getString(2);
    String userGender = mCursor.getString(4);
    ArrayList<String> data = new ArrayList<String>();
    data.add(Integer.toString(userId));
    data.add(userName);
    data.add(userAge);
    data.add(userGender);
    return data;
}

[Buggy Hunk]
ArrayList<String> getUser(int id){

[Patch]
public ArrayList<String> getUser(int id){

[Demonstration 3]

[Buggy Method]
public void studentDataInput(SQLiteDatabase db) {
    ContentValues cValues = new ContentValues();
    cValues.put(MyDBHandler.COLUMN_USN, getUsn());
    cValues.put(MyDBHandler.COLUMN_NAME, getName());
    cValues.put(MyDBHandler.COLUMN_PHONENO, getPhoneno());
    cValues.put(MyDBHandler.COLUMN_EMAIL, getEmail());
    cValues.put(MyDBHandler.COLUMN_SEMESTER, getSemester());
    cValues.put(MyDBHandler.COLUMN_BRANCH, getBranch());
    cValues.put(MyDBHandler.COLUMN_SECTION, getSection());
    cValues.put(MyDBHandler.COLUMN_SUB1, getSub1());
    cValues.put(MyDBHandler.COLUMN_SUB2, getSub2());
    cValues.put(MyDBHandler.COLUMN_SUB3, getSub3());
    cValues.put(MyDBHandler.COLUMN_SUB4, getSub4());
    cValues.put(MyDBHandler.COLUMN_SUB5, getSub5());
    cValues.put(MyDBHandler.COLUMN_SUB6, getSub6());
    db.insert(MyDBHandler.TABLE_STUDENT, null, cValues);
}

[Buggy Hunk]
cValues.put(MyDBHandler.COLUMN_EMAIL, getEmail());

[Patch]
cValues.put(MyDBHandler.COLUMN_EMAILID, getEmailid());