[Demonstration 1]

[Buggy Method]
@Override
protected void onCreate(Bundle savedInstanceState) {
    getGamesUrl = getResources().getString(R.string.APIBaseUrl) + "shooters/games";
    if (SaveSharedPreference.getFirstTime(getApplicationContext())) {
        Installation.id(getApplicationContext());
        SaveSharedPreference.setFirstTime(getApplicationContext(), false);
    }
    loggedIn = !(SaveSharedPreference.getPassword(getApplicationContext()).length() == 0);
    if (!loggedIn) {
        Intent intent = new Intent(MainActivity.this, LoginActivity.class);
        startActivity(intent);
    }
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    settings = PreferenceManager.getDefaultSharedPreferences(this);
    dirPath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/QwikStats/";
    progressBarHolder = (FrameLayout) this.findViewById(R.id.progressBarHolderMain);
    //btnNewGame = (Button) findViewById(R.id.newGameBtn);
    //btnOpenGame = (Button) findViewById(R.id.openGameBtn);
    //settingsBtn = (Button) findViewById(R.id.settingsBtn);
    qwikboxBtn = (Button) findViewById(R.id.qwikboxBtn);
    logoutBtn = (Button) findViewById(R.id.logoutBtn);
    //btnNewGame.setOnClickListener(this);
    //btnOpenGame.setOnClickListener(this);
    //settingsBtn.setOnClickListener(this);
    qwikboxBtn.setOnClickListener(this);
    logoutBtn.setOnClickListener(this);
    if (loggedIn) {
        logoutBtn.setText("Log Out");
    } else {
        logoutBtn.setText("Log In");
    }
    /*Toolbar actionBar = (Toolbar) findViewById(R.id.actionBar);
        actionBar.setTitle("SpeakStats");
        actionBar.setTitleTextColor(Color.WHITE);
        actionBar.setBackgroundColor(Color.parseColor(themeColor));
        setSupportActionBar(actionBar);*/
    checkPerm();
    displayingGames = false;
    //initialDialog();
}

[Buggy Hunk]
loggedIn = !(SaveSharedPreference.getPassword(getApplicationContext()).length() == 0);

[Patch]
loggedIn = !(SaveSharedPreference.getToken(getApplicationContext()).length() == 0);

[Demonstration 2]

[Buggy Method]
@Override
@BeforeSuite(alwaysRun = true)
public void signIn() {
    testHelper.beginTest("signIn");
    boolean pass = true;
    try {
        webPostagePage = new WebPostagePage(launchBrowser());
        printPostagePage = webPostagePage.clickPrintPostage();
        printPostageModule = printPostagePage.getPrintModule();
        printFormHelper = new PostageFormHelper(webPostagePage);
        testHelper.log("Operating System ", getOs());
        testHelper.log("Browser and Version ", getBrowserWithVersion());
        printFormHelper.getUrl();
        printFormHelper.signIn();
        printFormHelper.setReturnAddressBean(getShippingAddressBean());
    } catch (Exception sie) {
        testHelper.logErrorTagStart();
        errorMessage = sie.getMessage();
        pass = false;
        testHelper.logError(errorMessage);
        captureScreenShot(String.format("%s_FAIL_%s", testHelper.getTestName(), errorMessage));
        sie.printStackTrace();
        testHelper.logErrorTagEnd();
    }
    Assert.assertTrue(pass, String.format("%s: %s ", testHelper.getTestName(), errorMessage));
    testHelper.endTest();
}

[Buggy Hunk]
webPostagePage = new WebPostagePage(launchBrowser());

[Patch]
webPostagePage = new WebPostagePage(getDriver());

[Demonstration 3]

[Buggy Method]
@Override
public void execute(Request request) throws IOException {
    if (Server.getServer().getClientManager().isNick(request.getArgs()[0])) {
        request.getConnection().send(Error.ERR_NICKNAMEINUSE, request.getClient(), request.getArgs()[0] + " :Nickname is already in use");
        request.getConnection().close();
        return;
    }
    request.getConnection().setClient(new Client(request.getConnection(), request.getArgs()[0]));
    //request.getConnection().send(":" + Server.getServer().getConfig().getProperty("hostname") + " NOTICE * :*** No Ident response");
}

[Buggy Hunk]
request.getConnection().send(Error.ERR_NICKNAMEINUSE, request.getClient(), request.getArgs()[0] + " :Nickname is already in use");

[Patch]
request.getConnection().send(Error.ERR_NICKNAMEINUSE, "*", request.getArgs()[0] + " :Nickname is already in use");