[Demonstration 1]

[Buggy Method]
public void SaveHandler(BaseEntity entity) {
    User user = securityService.getUser();
    if (entity.getId() == null) {
        entity.setCreated_by(user);
        entity.setUpdate_by(user);
        entity.setCreated_date(new Date());
        entity.setUpdate_date(new Date());
    } else {
        entity.setUpdate_date(new Date());
        entity.setUpdate_by(user);
    }
}

[Buggy Hunk]
public void SaveHandler(BaseEntity entity){

[Patch]
protected void SaveHandler(BaseEntity entity){

[Demonstration 2]

[Buggy Method]
private synchronized <T extends IMountedFile> T openFile(T file, Closeable handle) throws FileSystemException {
    synchronized (m_openFiles) {
        if (ComputerCraft.maximumFilesOpen > 0 && m_openFiles.size() >= ComputerCraft.maximumFilesOpen) {
            if (handle != null) {
                try {
                    handle.close();
                } catch (IOException ignored) {
                    // shrug
                }
            }
            throw new FileSystemException("Too many files already open");
        }
        m_openFiles.put(file, null);
        return file;
    }
}

[Buggy Hunk]
m_openFiles.put( file, null );

[Patch]
m_openFiles.add( file );

[Demonstration 3]

[Buggy Method]
@ReceiveEvent
public void onHarvest(ActivateEvent event, EntityRef entity) {
    EntityRef target = event.getTarget();
    EntityRef instigator = event.getInstigator();
    EntityRef harvestingEntity = entity;
    if (entity.equals(event.getTarget())) {
        harvestingEntity = instigator;
    }
    if (!event.isConsumed() && target.exists() && harvestingEntity.exists() && harvestingEntity.hasComponent(InventoryComponent.class)) {
        PlantProduceComponent plantProduceComponent = target.getComponent(PlantProduceComponent.class);
        if (plantProduceComponent != null) {
            inventoryManager.giveItem(entity, target, plantProduceComponent.produceItem);
            plantProduceComponent.produceItem = EntityRef.NULL;
            target.saveComponent(plantProduceComponent);
            target.send(new OnPlantHarvest());
            event.consume();
        }
    }
}

[Buggy Hunk]
inventoryManager.giveItem(entity, target, plantProduceComponent.produceItem);

[Patch]
inventoryManager.giveItem(harvestingEntity, target, plantProduceComponent.produceItem);