[Demonstration 1]

[Buggy Method]
@Override
public void write(byte[] buffer, int offset, int count) throws IOException {
    super.write(buffer, offset, count);
    size += count;
}

[Buggy Hunk]
super.write(buffer, offset, count);

[Patch]
out.write(buffer, offset, count);

[Demonstration 2]

[Buggy Method]
@Override
public void withdraw(double x) throws NotEnoughFundsException {
    if (x > 0 && x <= availableFunds())
        accountModified(balance, balance -= x);
    else
        throw new NotEnoughFundsException(x);
}

[Buggy Hunk]
if (x > 0 && x <= availableFunds())

[Patch]
if (x >= 0 && x <= availableFunds())

[Demonstration 3]

[Buggy Method]
void animateIndicatorToPosition(final int position, int duration) {
    final boolean isRtl = ViewCompat.getLayoutDirection(this) == ViewCompat.LAYOUT_DIRECTION_RTL;
    final View targetView = getChildAt(position);
    final int targetLeft = targetView.getLeft();
    final int targetRight = targetView.getRight();
    final int startLeft;
    final int startRight;
    if (Math.abs(position - mSelectedPosition) <= 1) {
        // If the views are adjacent, we'll animate from edge-to-edge
        startLeft = mIndicatorLeft;
        startRight = mIndicatorRight;
    } else {
        // Else, we'll just grow from the nearest edge
        final int offset = dpToPx(MOTION_NON_ADJACENT_OFFSET);
        if (position < mSelectedPosition) {
            // We're going end-to-start
            if (isRtl) {
                startLeft = startRight = targetLeft - offset;
            } else {
                startLeft = startRight = targetRight + offset;
            }
        } else {
            // We're going start-to-end
            if (isRtl) {
                startLeft = startRight = targetRight + offset;
            } else {
                startLeft = startRight = targetLeft - offset;
            }
        }
    }
    if (startLeft != targetLeft || startRight != targetRight) {
        ValueAnimatorCompat animator = ViewUtils.createAnimator();
        animator.setInterpolator(AnimationUtils.FAST_OUT_SLOW_IN_INTERPOLATOR);
        animator.setDuration(duration);
        animator.setFloatValues(0, 1);
        animator.setUpdateListener(new ValueAnimatorCompat.AnimatorUpdateListener() {

            @Override
            public void onAnimationUpdate(ValueAnimatorCompat animator) {
                final float fraction = animator.getAnimatedFraction();
                setIndicatorPosition(AnimationUtils.lerp(startLeft, targetLeft, fraction), AnimationUtils.lerp(startRight, targetRight, fraction));
            }
        });
        animator.setListener(new ValueAnimatorCompat.AnimatorListenerAdapter() {

            @Override
            public void onAnimationEnd(ValueAnimatorCompat animator) {
                mSelectedPosition = position;
                mSelectionOffset = 0f;
            }

            @Override
            public void onAnimationCancel(ValueAnimatorCompat animator) {
                mSelectedPosition = position;
                mSelectionOffset = 0f;
            }
        });
        animator.start();
    }
}

[Buggy Hunk]
ValueAnimatorCompat animator = ViewUtils.createAnimator();

[Patch]
ValueAnimatorCompat animator = mIndicatorAnimator = ViewUtils.createAnimator();