[Demonstration 1]

[Buggy Method]
public static void addUser(String username, String password, String[] groups) {
    loginService.putUser(username, new Password(password), groups);
}

[Buggy Hunk]
loginService.putUser(username, new Password(password), groups);

[Patch]
loginService.putUser(username, Credential.Crypt.getCredential(Credential.Crypt.crypt(username, password)), groups);

[Demonstration 2]

[Buggy Method]
@Override
protected void drawMainText(Canvas canvas) {
    String text = (String) getText();
    if (text.contains("/")) {
        getPaint().setColor(getCurrentTextColor());
        if (mUnderline)
            getPaint().setUnderlineText(true);
        canvas.drawText(mTopText, 0, mTopText.length(), mTopTextX, mTopTextY, getPaint());
        getPaint().setUnderlineText(false);
        canvas.drawText(mBotText, 0, mBotText.length(), mBotTextX, mBotTextY, getPaint());
        if (text.contains(mArrowText)) {
            canvas.drawText(mArrowText, 0, mArrowText.length(), mArrowTextX, mArrowTextY, getPaint());
        }
    } else
        super.drawMainText(canvas);
}

[Buggy Hunk]
String text = (String) getText();

[Patch]
String text = getText().toString();

[Demonstration 3]

[Buggy Method]
public int getRedPixelCount(BufferedImage image) {
    int count = 0;
    for (int i = 0; i < image.getWidth(); i++) {
        for (int j = 0; j < image.getHeight(); j++) {
            Color color = new Color(image.getRGB(x, y));
            if (isRed(color)) {
                count++;
            }
        }
    }
    return count;
}

[Buggy Hunk]
Color color = new Color(image.getRGB(x,y));

[Patch]
Color color = new Color(image.getRGB(i,j));