[Demonstration 1]

[Buggy Method]
public static void showAlert(Throwable ex) {
    Alert alert = new Alert(AlertType.ERROR);
    alert.setTitle("Exception Alert");
    alert.setHeaderText("Exception Dialog");
    alert.setContentText(ex.getMessage());
    // Create expandable Exception.
    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    ex.printStackTrace(pw);
    String exceptionText = sw.toString();
    Label label = new Label("Exception stacktrace:");
    TextArea textArea = new TextArea(exceptionText);
    textArea.setEditable(false);
    textArea.setWrapText(true);
    textArea.setMaxWidth(Double.MAX_VALUE);
    textArea.setMaxHeight(Double.MAX_VALUE);
    GridPane.setVgrow(textArea, Priority.ALWAYS);
    GridPane.setHgrow(textArea, Priority.ALWAYS);
    GridPane expContent = new GridPane();
    expContent.setMaxWidth(Double.MAX_VALUE);
    expContent.add(label, 0, 0);
    expContent.add(textArea, 0, 1);
    // Set expandable Exception into the dialog pane.
    alert.getDialogPane().setExpandableContent(expContent);
    alert.show();
}

[Buggy Hunk]
public static void showAlert(Throwable ex) {

[Patch]
private static void showAlert(Throwable ex) {

[Demonstration 2]

[Buggy Method]
@SuppressWarnings("PMD.NullAssignment")
public Optional<String> getCurrentStep() {
    final LinkedList<String> uids = currentStepContext.get();
    return uids.isEmpty() ? Optional.empty() : Optional.of(uids.getFirst());
}

[Buggy Hunk]
final LinkedList<String> uids = currentStepContext.get();

[Patch]
final Deque<String> uids = getStepContext();

[Demonstration 3]

[Buggy Method]
void consumeAsyncInternal(final Purchase purchase) throws IabAsyncInProgressException {
    final Handler handler = new Handler();
    start_async(new Thread(new Runnable() {

        public void run() {
            IabResult result;
            try {
                consume(purchase);
                result = new IabResult(BILLING_RESPONSE_RESULT_OK, "Successful consume of sku " + purchase.getSku());
            } catch (IabException ex) {
                result = ex.getResult();
            }
            flag_end_async();
            final IabResult result_f = result;
            handler.post(new Runnable() {

                public void run() {
                    m_purchase_map.remove(purchase.getSku());
                    on_iap_confirm_transaction_finished(purchase, result_f);
                }
            });
        }
    }));
}

[Buggy Hunk]
void consumeAsyncInternal(final Purchase purchase)

[Patch]
private void consumeAsyncInternal(final Purchase purchase)