[Demonstration 1]

[Buggy Method]
private void update() {
    // Update all entities
    for (Entity e : entities) {
        e.update();
    }
    // Loop over entities and figure out their movements
    for (Entity e : entities) {
        synchronized (this) {
            e.applyGravity();
            e.colliding = false;
            List<Line2D.Double> collisions = e.getConflicts();
            int count = 0;
            int max = 100;
            while (count < max && !R.isRemoved(e) && !collisions.isEmpty()) {
                for (Line2D.Double c : collisions) {
                    e.onCollision(c);
                }
                collisions = e.getConflicts();
                count++;
            }
            if (count == max) {
                e.dx = 0;
                e.dy = 0;
            }
            e.x += e.dx;
            e.y += e.dy;
        }
    }
    // Loop over entities and determine if they are overlapping with other entities
    for (Entity e : entities) {
        for (Entity o : entities) {
            if (e.x + e.hitBoxWidth / 2.0 > o.x - o.hitBoxWidth / 2.0 && e.x - e.hitBoxWidth / 2.0 < o.x + o.hitBoxWidth / 2.0 && e.y + e.hitBoxHeight / 2.0 > o.y - o.hitBoxHeight / 2.0 && e.y - e.hitBoxHeight / 2.0 < o.y + o.hitBoxHeight / 2.0) {
                if (e != o)
                    e.interactWith(o);
            }
        }
    }
    // Actually remove the ones which were told to be removed
    R.removeEntities();
}

[Buggy Hunk]
for(Entity e : entities) { synchronized(this) {

[Patch]
for(Entity e : entities) { synchronized(e) {

[Demonstration 2]

[Buggy Method]
public GeometrySpace makeEmptySpace() {
    return new GeometrySpace(geometryFactory.createPoint((CoordinateSequence) null));
}

[Buggy Hunk]
return new GeometrySpace(geometryFactory.createPoint((CoordinateSequence) null));

[Patch]
return new GeometrySpace(geometryFactory.createPoint((CoordinateSequence) null), config.geometryPrecision);

[Demonstration 3]

[Buggy Method]
public ArrayList<Entity> getEntities() {
    return entities;
}

[Buggy Hunk]
public ArrayList<Entity> getEntities() {

[Patch]
public CopyOnWriteArrayList<Entity> getEntities() {