[Demonstration 1]

[Buggy Method]
private boolean handleEndTouchEvent(@NonNull final MotionEvent event, final int x) {
    if ((undo && currentTouchView != null) || (isSwipeable(currentTouchView) && !((ViewConfiguration.getTapTimeout() < (event.getEventTime() - event.getDownTime())) || (ViewConfiguration.get(getContext()).getScaledTouchSlop() < getDistanceTo(event))))) {
        updateParams(currentTouchView, 0);
        if (undo && !moved) {
            ((Button) currentTouchView.findViewById(R.id.undo)).callOnClick();
        } else {
            currentTouchView.onTouchEvent(event);
        }
        currentTouchView = null;
        return true;
    }
    synchronized (this) {
        resetThread = new Thread(new Runnable() {

            @Override
            public void run() {
                try {
                    Thread.sleep(100L);
                } catch (final InterruptedException ignored) {
                    return;
                }
                synchronized (SwipeLinearLayout.this) {
                    if (moved && (resetThread != null) && !resetThread.isInterrupted() && (currentTouchView != null) && !isRemoving) {
                        currentTouchView.post(new Runnable() {

                            @Override
                            public void run() {
                                animateView((int) (x - xDown), 300L, new DecelerateInterpolator(), new ValueAnimator.AnimatorUpdateListener() {

                                    @Override
                                    public void onAnimationUpdate(final ValueAnimator animation) {
                                        updateParams(currentTouchView, (Integer) animation.getAnimatedValue());
                                    }
                                }, new EndMoveAnimatorListener(new AnimationEnd() {

                                    @Override
                                    public void onAnimationEnd(@NonNull final Animator animation) {
                                        currentTouchView = null;
                                        if (getParent() != null) {
                                            getParent().requestDisallowInterceptTouchEvent(false);
                                        }
                                    }
                                }));
                            }
                        });
                        resetThread = null;
                    }
                }
            }
        });
        resetThread.start();
    }
    return false;
}

[Buggy Hunk]
((Button)currentTouchView.findViewById(R.id.undo)).callOnClick();

[Patch]
((Button) currentTouchView.findViewById(R.id.undo)).performClick();

[Demonstration 2]

[Buggy Method]
@DeleteMapping("/{customer-id}")
public HttpEntity delete(@PathVariable("customer-id") Long id) {
    if (customerService.deleteById(id)) {
        return ResponseEntity.status(HttpStatus.OK).build();
    }
    return ResponseEntity.status(HttpStatus.BAD_REQUEST).build();
}

[Buggy Hunk]
return ResponseEntity.status(HttpStatus.BAD_REQUEST).build();

[Patch]
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).build();

[Demonstration 3]

[Buggy Method]
@Override
public Response toResponse(JsonProcessingException exception) {
    /*
         * If the error is in the JSON generation, it's a server error.
         */
    if (exception instanceof JsonGenerationException) {
        LOGGER.warn("Error generating JSON", exception);
        return Response.serverError().build();
    }
    final String message = exception.getOriginalMessage();
    /*
         * If we can't deserialize the JSON because someone forgot a no-arg
         * constructor, or it is not known how to serialize the type it's
         * a server error and we should inform the developer.
         */
    if (exception instanceof JsonMappingException && !(exception instanceof UnrecognizedPropertyException)) {
        LOGGER.error("Unable to serialize or deserialize the specific type", exception);
        return Response.serverError().build();
    }
    /*
         * Otherwise, it's those pesky users.
         */
    LOGGER.debug("Unable to process JSON", exception);
    final ErrorMessage errorMessage = new ErrorMessage(Response.Status.BAD_REQUEST.getStatusCode(), "Unable to process JSON", showDetails ? message : null);
    return Response.status(Response.Status.BAD_REQUEST).type(MediaType.APPLICATION_JSON_TYPE).entity(errorMessage).build();
}

[Buggy Hunk]
if (exception instanceof JsonMappingException && !(exception instanceof UnrecognizedPropertyException)) {

[Patch]
if (Throwables.getRootCause(exception).getClass() == JsonMappingException.class) {