[Demonstration 1]

[Buggy Method]
private String negate(String x) {
    BigDecimal i = new BigDecimal(x);
    BigDecimal k = i.negate();
    k = k.stripTrailingZeros();
    return k.toPlainString();
}

[Buggy Hunk]
BigDecimal i = new BigDecimal(x);

[Patch]
BigDecimal i = new BigDecimal(getValue(x).toString());

[Demonstration 2]

[Buggy Method]
public void copyAttachedDatabase(Context context, String databaseName) {
    final File dbPath = context.getDatabasePath(databaseName);
    // If the database already exists, return
    if (dbPath.exists()) {
        return;
    }
    // Make sure we have a path to the file
    dbPath.getParentFile().mkdirs();
    // Try to copy database file
    try {
        final InputStream inputStream = context.getAssets().open(databaseName);
        final OutputStream output = new FileOutputStream(dbPath);
        byte[] buffer = new byte[8192];
        int length;
        while ((length = inputStream.read(buffer, 0, 8192)) > 0) {
            output.write(buffer, 0, length);
        }
        output.flush();
        output.close();
        inputStream.close();
    } catch (IOException e) {
        ProactiveLog.e("Failed to open file", e);
    }
}

[Buggy Hunk]
final File dbPath = context.getDatabasePath(databaseName);

[Patch]
final File dbPath = new File(context.getApplicationContext().getFilesDir(), databaseName);

[Demonstration 3]

[Buggy Method]
public static boolean isSkill(ItemStack stack) {
    // Loops through all Skills defined in SkillType and checks if stack is that skill.
    for (int i = 0; i < SkillType.values().length; i++) {
        if (SkillType.values()[i].getDisplay().getStack().equals(stack)) {
            return true;
        }
    }
    return false;
}

[Buggy Hunk]
if(SkillType.values()[i].getDisplay().getStack().equals(stack)) {

[Patch]
if(SkillType.values()[i].getDisplay().getStack().isSimilar(stack)) {