[Demonstration 1]

[Buggy Method]
public List<ReadEmailInfo> readAllEmailInfos(Session sendMailSession, EmailServerInfo emailServerInfo) {
    List<ReadEmailInfo> allEmailInfos = null;
    Store store = null;
    try {
        store = sendMailSession.getStore("pop3");
        store.connect(emailServerInfo.getUserName(), emailServerInfo.getPassword());
        FetchingEmailUtil fetchingEmailUtil = new FetchingEmailUtil();
        fetchingEmailUtil.fetchingLatestEmailFromStore(store, true);
        // close the store
        return allEmailInfos;
    } catch (Exception e) {
        e.printStackTrace();
        return null;
    } finally {
        try {
            if (store != null) {
                store.close();
            }
        } catch (MessagingException e) {
            e.printStackTrace();
        }
    }
}

[Buggy Hunk]
fetchingEmailUtil.fetchingLatestEmailFromStore(store, true);

[Patch]
allEmailInfos = fetchingEmailUtil.fetchingAllEmailInfos(store, true);

[Demonstration 2]

[Buggy Method]
public T front() {
    return (T) this.store.getHead().getData();
}

[Buggy Hunk]
return (T) this.store.getHead().getData();

[Patch]
return this.store.getHead() == null ?  null : (T)this.store.getHead().getData();

[Demonstration 3]

[Buggy Method]
public void dismiss(Intent intent) {
    if (intent != null) {
        if (intent.hasExtra(NotificationIntentService.EXTRA_CLEAR_ID)) {
            final long clearId = intent.getLongExtra(NotificationIntentService.EXTRA_CLEAR_ID, -1);
            if (clearId > -1)
                Tasks.execute(new Task<Object>() {

                    @Override
                    public String getId() {
                        return "auto-dismiss";
                    }

                    @Override
                    public void run(Context context) {
                        NotificationMessage message = NotificationManager.getInstance().getMessage(clearId);
                        NotificationManager.getInstance().removeMessage(message);
                        onComplete();
                    }
                });
        } else if (intent.hasExtra(NotificationIntentService.EXTRA_CLEAR_ALL)) {
            final String groupKey = intent.hasExtra(NotificationIntentService.EXTRA_GROUP_KEY) ? intent.getStringExtra(NotificationIntentService.EXTRA_GROUP_KEY) : "";
            Tasks.execute(new Task<Object>() {

                @Override
                public String getId() {
                    return "auto-dismiss";
                }

                @Override
                public void run(Context context) {
                    NotificationManager.getInstance().removeMessages(groupKey);
                    onComplete();
                }
            });
        }
        if (intent.hasExtra(AUTO_DISMISS_TAG) && intent.hasExtra(AUTO_DISMISS_ID)) {
            final String tag = intent.getStringExtra(AUTO_DISMISS_TAG);
            final int id = intent.getIntExtra(AUTO_DISMISS_ID, 0);
            NotificationManagerCompat.from(CONTEXT).cancel(tag, id);
        }
    }
}

[Buggy Hunk]
public void dismiss(Intent intent) {

[Patch]
public static void dismiss(Intent intent) {