[Demonstration 1]

[Buggy Method]
@SuppressWarnings({ "unchecked", "rawtypes" })
private Shot finishShot(Shot shot) {
    if (shot == null) {
        return null;
    }
    int shotNumber = idCounter.incrementAndGet();
    String shotId = Shot.generateShotID(movieId, shotNumber);
    shot.setShotId(shotId);
    addSubtitleItems(shot);
    PersistentTuple tuple = this.pwriter.generateTuple(shotId, movieId, shot.getStart(), shot.getEnd());
    this.pwriter.persist(tuple);
    return shot;
}

[Buggy Hunk]
PersistentTuple tuple = this.pwriter.generateTuple(shotId, movieId, shot.getStart(), shot.getEnd());

[Patch]
PersistentTuple tuple = this.pwriter.generateTuple(shotId, movieId, shotNumber, shot.getStart(), shot.getEnd());

[Demonstration 2]

[Buggy Method]
@SuppressWarnings("unchecked")
public static ArrayList<GeneralEntity> getCollidingEntities(GeneralEntity toCheck) {
    ArrayList<GeneralEntity> all = (ArrayList<GeneralEntity>) World.getCurrentWorldContainer().entities.clone();
    ArrayList<GeneralEntity> collidingWith = new ArrayList<GeneralEntity>();
    for (GeneralEntity e : all) {
        if (e.collisionBox.intersects(toCheck.collisionBox)) {
            collidingWith.add(e);
        }
    }
    return collidingWith;
}

[Buggy Hunk]
ArrayList<GeneralEntity> all = (ArrayList<GeneralEntity>) World.getCurrentWorldContainer().entities.clone();

[Patch]
ArrayList<GeneralEntity> all = (ArrayList<GeneralEntity>) World.getCurrentWorldContainer().getEntities().clone();

[Demonstration 3]

[Buggy Method]
public void tick(Game game) {
    double timeScale = 1;
    for (int j = 0; j < map.tiles.size(); j++) {
        player.handleCollision(map.tiles.get(j));
    }
    for (int i = 0; i < entities.size(); i++) {
        player.handleCollision(entities.get(i));
        for (int j = 0; j < map.tiles.size(); j++) {
            entities.get(i).handleCollision(map.tiles.get(j));
        }
        for (int j = i + 1; j < entities.size(); j++) {
            entities.get(i).handleCollision(entities.get(j));
        }
    }
    for (Entity entity : entities) {
        entity.tick(timeScale);
    }
    player.tick();
}

[Buggy Hunk]
player.tick();

[Patch]
player.tick(timeScale);