[Demonstration 1]

[Buggy Method]
@Override
public boolean onTouchEvent(MotionEvent ev) {
    switch(ev.getActionMasked()) {
        case MotionEvent.ACTION_DOWN:
            mDownY = mLastY = ev.getY();
            isTouchEventConsumed = false;
            isAllowedToScrollBack = false;
            scroller.forceFinished(false);
            recordScrollDistance();
            break;
        case MotionEvent.ACTION_POINTER_UP:
            recordScrollDistance();
            isResetCoordinateNeeded = true;
            break;
        case MotionEvent.ACTION_POINTER_DOWN:
            isResetCoordinateNeeded = true;
            recordScrollDistance();
            break;
        case MotionEvent.ACTION_MOVE:
            mLastY = ev.getY();
            final float diff;
            resetCoordinateIfNeeded();
            resetCoordinateWhenHeaderReachesTheEnd();
            diff = mLastY - mDownY;
            if (diff <= -1f) {
                currentMode = SCROLL_UP;
                mLastDistance = (int) diff;
                scrolling();
            } else if (diff >= 1f) {
                clearFocus();
                currentMode = SCROLL_DOWN;
                mLastDistance = (int) diff;
                scrolling();
            }
            break;
        case MotionEvent.ACTION_CANCEL:
        case MotionEvent.ACTION_UP:
            isAllowedToScrollBack = true;
            isTouchEventConsumed = false;
            if (mLastDistance > 0) {
                scrollBackToTop();
            }
            break;
    }
    if (isTouchEventConsumed) {
        return true;
    }
    return super.onTouchEvent(ev);
}

[Buggy Hunk]
if (mLastDistance > 0) {

[Patch]
if (headerLayoutParams.height > heightOfHeader) {

[Demonstration 2]

[Buggy Method]
@Override
public boolean onTouchEvent(MotionEvent event) {
    PointF curr = new PointF(event.getX(), event.getY());
    Log.i(TAG, "Received event at x=" + curr.x + ", y=" + curr.y + ":");
    final int action = event.getAction();
    switch(action) {
        case MotionEvent.ACTION_DOWN:
            Log.i(TAG, "  ACTION_DOWN");
            mCurrentBox = new Box(curr);
            mBoxes.add(mCurrentBox);
            break;
        case MotionEvent.ACTION_POINTER_DOWN:
            final int count = event.getPointerCount();
            Log.w(TAG, "count : " + count);
            final int index = event.getActionIndex();
            final int mask = event.getActionMasked();
            final int id = event.getPointerId(index);
            Log.w(TAG, "index : " + index + "\nid : " + id + "\n mask : " + mask);
            break;
        case MotionEvent.ACTION_MOVE:
            Log.i(TAG, "  ACTION_MOVE");
            if (mCurrentBox != null) {
                mCurrentBox.setCurrent(curr);
                invalidate();
            }
            break;
        case MotionEvent.ACTION_UP:
            Log.i(TAG, "  ACTION_UP");
            mCurrentBox = null;
            break;
        case MotionEvent.ACTION_CANCEL:
            Log.i(TAG, "  ACTION_CANCEL");
            mCurrentBox = null;
            break;
    }
    return true;
}

[Buggy Hunk]
public boolean onTouchEvent(MotionEvent event) {

[Patch]
public boolean onTouchEvent(@NonNull MotionEvent event) {

[Demonstration 3]

[Buggy Method]
@Override
public void onNext(Weather weather) {
    mWeather.status = weather.status;
    mWeather.aqi = weather.aqi;
    mWeather.basic = weather.basic;
    mWeather.suggestion = weather.suggestion;
    mWeather.now = weather.now;
    mWeather.dailyForecast = weather.dailyForecast;
    mWeather.hourlyForecast = weather.hourlyForecast;
    //mActivity.getToolbar().setTitle(weather.basic.city);
    safeSetTitle(weather.basic.city);
    mAdapter.notifyDataSetChanged();
    normalStyleNotification(weather);
}

[Buggy Hunk]
normalStyleNotification(weather);

[Patch]
Util.normalStyleNotification(weather,getActivity(),MainActivity.class);