[Demonstration 1]

[Buggy Method]
@Override
public void onClick(View view) {
    if (imageButtonListener != null) {
        imageButtonListener.onClick(view, position);
    }
}

[Buggy Hunk]
imageButtonListener.onClick(view, position);

[Patch]
imageButtonListener.onClick(view, position, multiplePracticeSeekBar.getProgress());

[Demonstration 2]

[Buggy Method]
public static void addEvents(ArrayList<Event> list, Context context) {
    // Populate arraylist to be given to Recycler adapter:
    EventGenerator eg = EventGenerator.getInstance(context);
    ArrayList<Event> tempEvents = eg.getEvents();
    for (Event e : tempEvents) {
        if (e.isShowAsStarred()) {
            Log.d("Starred:", e.getName());
            list.add(e);
        }
    }
}

[Buggy Hunk]
if(e.isShowAsStarred()) {

[Patch]
if(e.isStarred()) {

[Demonstration 3]

[Buggy Method]
void takeScreenshotPartial(final Runnable finisher, final boolean statusBarVisible, final boolean navBarVisible) {
    mWindowManager.addView(mScreenshotLayout, mWindowLayoutParams);
    mScreenshotSelectorView.setOnTouchListener(new View.OnTouchListener() {

        @Override
        public boolean onTouch(View v, MotionEvent event) {
            ScreenshotSelectorView view = (ScreenshotSelectorView) v;
            switch(event.getAction()) {
                case MotionEvent.ACTION_DOWN:
                    view.startSelection((int) event.getX(), (int) event.getY());
                    return true;
                case MotionEvent.ACTION_MOVE:
                    view.updateSelection((int) event.getX(), (int) event.getY());
                    return true;
                case MotionEvent.ACTION_UP:
                    view.setVisibility(View.GONE);
                    mWindowManager.removeView(mScreenshotLayout);
                    final Rect rect = view.getSelectionRect();
                    if (rect != null) {
                        if (rect.width() != 0 && rect.height() != 0) {
                            // Need mScreenshotLayout to handle it after the view disappears
                            mScreenshotLayout.post(new Runnable() {

                                public void run() {
                                    takeScreenshot(finisher, statusBarVisible, navBarVisible, rect.left, rect.top, rect.width(), rect.height());
                                }
                            });
                        }
                    }
                    view.stopSelection();
                    return true;
            }
            return false;
        }
    });
    mScreenshotLayout.post(new Runnable() {

        @Override
        public void run() {
            mScreenshotSelectorView.setVisibility(View.VISIBLE);
            mScreenshotSelectorView.requestFocus();
        }
    });
}

[Buggy Hunk]
if (rect.width() != 0 && rect.height() != 0) {

[Patch]
if (rect.left >= 0 && rect.top >= 0 && rect.width() != 0 && rect.height() != 0) {