[Demonstration 1]

[Buggy Method]
@Override
public boolean useBonusPoints(BonusPointable customer, Movie movie) {
    if (isBonusPointsChargeable(customer, movie)) {
        customer.useBonusPoints(CHARGEABLE_BONUS_POINTS);
        return true;
    }
    return false;
}

[Buggy Hunk]
if(isBonusPointsChargeable(customer, movie)){

[Patch]
if(customer != null && isBonusPointsChargeable(customer, movie)){

[Demonstration 2]

[Buggy Method]
private static File createFileFromInputStream(InputStream inputStream, String encoding) {
    final File file;
    final File tempDir = FileHelper.getTempDir();
    File fileCandidate = null;
    boolean usableName = false;
    int index = 0;
    while (!usableName) {
        index++;
        fileCandidate = new File(tempDir, "metamodel" + index + ".csv");
        usableName = !fileCandidate.exists();
    }
    file = fileCandidate;
    final BufferedWriter writer = FileHelper.getBufferedWriter(file, encoding);
    final BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
    try {
        file.createNewFile();
        file.deleteOnExit();
        boolean firstLine = true;
        for (String line = reader.readLine(); line != null; line = reader.readLine()) {
            if (firstLine) {
                firstLine = false;
            } else {
                writer.write('\n');
            }
            writer.write(line);
        }
    } catch (IOException e) {
        throw new IllegalStateException(e);
    } finally {
        FileHelper.safeClose(writer, reader);
    }
    return file;
}

[Buggy Hunk]
final BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));

[Patch]
final BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, Charset.forName(encoding)));

[Demonstration 3]

[Buggy Method]
public List<YoutubeLink> getSearchResults(String query) {
    Cursor resultSet = connection.rawQuery("Select * from searches ORDER BY search_time DESC LIMIT 1", null);
    while (resultSet.moveToNext()) {
        String results = resultSet.getString(1);
        Type listType = new TypeToken<ArrayList<YoutubeLink>>() {
        }.getType();
        List<YoutubeLink> output = new Gson().fromJson(results, listType);
        return output;
    }
    return new LinkedList<>();
}

[Buggy Hunk]
Cursor resultSet = connection.rawQuery("Select * from searches ORDER BY search_time DESC LIMIT 1",null);

[Patch]
Cursor resultSet = connection.rawQuery("Select * from searches WHERE query = '"+query+"' ORDER BY search_time DESC LIMIT 1",null);