[Demonstration 1]

[Buggy Method]
@SuppressWarnings("unchecked")
private void load() throws RepositoryException {
    FileInputStream fis = null;
    ObjectInputStream ois = null;
    try {
        fis = new FileInputStream(f);
        ois = new ObjectInputStream(fis);
        while (ois.available() > 0) {
            Entity<T> e = (Entity<T>) ois.readObject();
            cache.put(e.getId(), e);
        }
    } catch (IOException | ClassNotFoundException e) {
        throw new RepositoryException(e);
    } finally {
        try {
            if (ois != null)
                ois.close();
            if (fis != null)
                fis.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

[Buggy Hunk]
} catch (IOException | ClassNotFoundException e) {

[Patch]
} catch (Exception e) {

[Demonstration 2]

[Buggy Method]
public static HashMap<String, HashMap<String, String>> addTransactions(HashMap<String, HashMap<String, String>> transactionsOld, HashMap<String, HashMap<String, String>> transactionsNew) {
    // Iterate over challenges
    Iterator<Entry<String, HashMap<String, String>>> itTypes = transactionsNew.entrySet().iterator();
    while (itTypes.hasNext()) {
        Map.Entry<String, HashMap<String, String>> types = (Map.Entry<String, HashMap<String, String>>) itTypes.next();
        // Iterate over students
        Iterator<Entry<String, String>> itStudents = types.getValue().entrySet().iterator();
        while (itStudents.hasNext()) {
            Map.Entry<String, String> students = (Map.Entry<String, String>) itStudents.next();
            transactionsOld.get(types.getKey()).put(students.getKey(), students.getValue());
        }
    }
    return transactionsOld;
}

[Buggy Hunk]
public static HashMap<String, HashMap<String, String>> addTransactions(

[Patch]
public synchronized static HashMap<String, HashMap<String, String>> addTransactions(

[Demonstration 3]

[Buggy Method]
private int positionToX(int position) {
    return (position < gameModel.AREA_DIMENSION) ? position : position % GameModel.AREA_DIMENSION;
}

[Buggy Hunk]
return (position < gameModel.AREA_DIMENSION)

[Patch]
return (position < GameModel.AREA_DIMENSION)