[Demonstration 1]

[Buggy Method]
public void showNotification() {
    String ns = Context.NOTIFICATION_SERVICE;
    NotificationManager notificationManager = (NotificationManager) getSystemService(ns);
    int icon = R.drawable.ic_lock_white_24dp;
    long when = System.currentTimeMillis();
    Context context = getApplicationContext();
    Intent notificationIntent = new Intent(this, ConfirmPinCodeActivity.class);
    PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
    Notification notification;
    notification = new Notification.Builder(context).setContentTitle("Mã xác nhận").setContentText(code + " Bạn đã đăng ký thành công! ").setSmallIcon(icon).setContentIntent(contentIntent).setWhen(when).setAutoCancel(true).build();
    notification.flags |= Notification.FLAG_AUTO_CANCEL;
    notification.defaults |= Notification.DEFAULT_SOUND;
    notificationManager.notify(5, notification);
}

[Buggy Hunk]
int icon = R.drawable.ic_lock_white_24dp;

[Patch]
int icon = R.drawable.splash;

[Demonstration 2]

[Buggy Method]
@Test
public void testNotificationNoDefaultMessage() {
    Notification notification = new Notification("new-issues");
    channel.deliver(notification, Mockito.anyString());
    Mockito.verify(slackClient, Mockito.never()).send(Mockito.anyString(), Mockito.any(SlackMessage.class));
}

[Buggy Hunk]
Notification notification = new Notification("new-issues");

[Patch]
Notification notification = new Notification(NOTIFICATION_TYPE);

[Demonstration 3]

[Buggy Method]
@Test
public void readWithExternalReference() throws IOException {
    String body = "<!DOCTYPE MyBean SYSTEM \"http://192.168.28.42/1.jsp\" [" + "  <!ELEMENT root ANY >\n" + "  <!ENTITY ext SYSTEM \"" + new ClassPathResource("external.txt", getClass()).getURI() + "\" >]><MyBean><string>&ext;</string></MyBean>";
    MockHttpInputMessage inputMessage = new MockHttpInputMessage(body.getBytes("UTF-8"));
    inputMessage.getHeaders().setContentType(new MediaType("application", "xml"));
    this.thrown.expect(IOException.class);
    this.converter.read(MyBean.class, inputMessage);
}

[Buggy Hunk]
this.thrown.expect(IOException.class);

[Patch]
this.thrown.expect(HttpMessageNotReadableException.class);