[Demonstration 1]

[Buggy Method]
public static void exit() {
    if (shutdownCommencing || JUnitTestTest.isJUnitTest()) {
        return;
    }
    shutdownCommencing = true;
    ShadowManager.log(Level.INFO, "Server shutdown commencing...");
    lockdown();
    try {
        ServiceManager.unloadAllServices();
        StatisticsManager.saveStatistics();
        PersistanceManager.getPersistanceManager().shutdown();
    } catch (Exception e) {
        ShadowManager.log(Level.WARNING, "Clean server shutdown has failed. Will forcefully continue shutdown", e);
    }
    ShadowManager.log(Level.INFO, "Server shutdown completed");
    ShadowManager.log(Level.INFO, "Syncing System Exit (60 Seconds)");
    long syncTime = 0;
    for (Thread thread : Thread.getAllStackTraces().keySet()) {
        if (syncTime > 60000) {
            break;
        }
        if (thread.equals(Thread.currentThread())) {
            continue;
        }
        if (thread.isAlive()) {
            long startTime = System.currentTimeMillis();
            try {
                if (!thread.isDaemon() && !thread.getName().equalsIgnoreCase("DestroyJavaVM")) {
                    ShadowManager.log(Level.INFO, "Waiting on Thread: " + thread.getName());
                    thread.interrupt();
                    thread.join(60000);
                    ShadowManager.log(Level.INFO, "Thread has exited: " + thread.getName());
                }
            } catch (InterruptedException e) {
                ShadowManager.log(Level.SEVERE, "Waiting on Thread " + thread.getName() + " for 60 seconds did not result in exit");
            }
            syncTime += System.currentTimeMillis() - startTime;
        }
    }
    ShadowManager.log(Level.INFO, "Killing Process. This was " + ((shutdownCommencing) ? "" : "NOT ") + " a scheduled restart");
    Runtime.getRuntime().halt((scheduledShutdown) ? 0 : -1);
}

[Buggy Hunk]
ShadowManager.log(Level.INFO, "Killing Process. This was " + ((shutdownCommencing)?"":"NOT ") + " a scheduled restart");

[Patch]
ShadowManager.log(Level.INFO, "Killing Process. This was" + ((scheduledShutdown)?" ":" NOT ") + "a scheduled restart");

[Demonstration 2]

[Buggy Method]
public void setUp() {
    this.activity = getActivity();
    this.enter = (Button) activity.findViewById(R.id.enterButton);
    this.hint = (ImageButton) activity.findViewById(R.id.btnHint);
    this.startGame = (Button) activity.findViewById(R.id.playAgainButton);
    this.jumbledWord = (TextView) activity.findViewById(R.id.scrambledWordTextView);
    this.result = (TextView) activity.findViewById(R.id.resultTextView);
}

[Buggy Hunk]
this.startGame = (Button) activity.findViewById(R.id.playAgainButton);

[Patch]
this.startGame = (Button) activity.findViewById(R.id.newGameButton);

[Demonstration 3]

[Buggy Method]
@Override
public OkHttpClient getOkHttpClient() {
    if (okHttpClient == null) {
        super.getOkHttpClient().newBuilder().addNetworkInterceptor(new StethoInterceptor()).build();
    }
    return okHttpClient;
}

[Buggy Hunk]
super.getOkHttpClient().newBuilder()

[Patch]
okHttpClient = super.getOkHttpClient().newBuilder()