[Demonstration 1]

[Buggy Method]
void close(LAB lab) {
    labs.remove(lab);
}

[Buggy Hunk]
labs.remove(lab);

[Patch]
commitableLabs.remove(lab);

[Demonstration 2]

[Buggy Method]
@Override
public String updateLabLocation(LabLocation location, Lab lab) {
    if (location == null || lab == null || lab.getId() == null || location.getId() == null) {
        return null;
    }
    Session session = this.sessionFactory.openSession();
    Transaction tx = session.beginTransaction();
    AppointmentDao appointmentDao = new AppointmentDaoImpl();
    Labs labs = appointmentDao.getLabById(lab.getId(), session);
    LabLocations labLocations = null;
    LocationWiseLabCharges charges = null;
    if (CollectionUtils.isNotEmpty(labs.getLabses())) {
        for (LabLocations locations : labs.getLabses()) {
            if (location.getId() == locations.getLocations().getId()) {
                labLocations = locations;
                break;
            }
        }
    }
    if (labLocations != null) {
        charges = appointmentDao.getLocationCharges(labs.getId(), labLocations.getId(), session);
        if (charges == null) {
            charges = new LocationWiseLabCharges();
            charges.setLabId(labs.getId().shortValue());
            charges.setLocationId(location.getId().shortValue());
        }
        charges.setPickUpCharge(location.getCharge() != null ? location.getCharge().shortValue() : 0);
        if (charges.getId() == null) {
            session.persist(charges);
        }
    } else {
        labLocations = new LabLocations();
        labLocations.setLocations(appointmentDao.getLocationsById(location.getId(), session));
        labLocations.setLabs(labs);
        if (location.getCharge() != null) {
            charges = new LocationWiseLabCharges();
            charges.setLabId(labs.getId().shortValue());
            charges.setLocationId(location.getId().shortValue());
            charges.setPickUpCharge(location.getCharge().shortValue());
            session.persist(charges);
        }
        session.persist(labLocations);
    }
    tx.commit();
    session.close();
    return RESPONSE_OK;
}

[Buggy Hunk]
charges = appointmentDao.getLocationCharges(labs.getId(), labLocations.getId(), session);

[Patch]
charges = appointmentDao.getLocationCharges(labs.getId(), labLocations.getLocations().getId(), session);

[Demonstration 3]

[Buggy Method]
@Override
public void act(float delta) {
    for (int i = 0; i < 2; i++) {
        if (backgrounds[i].getY() < -backgrounds[i].getHeight()) {
            int idx = (i == 0 ? 1 : 0);
            backgrounds[i].setY(backgrounds[idx].getY() + backgrounds[idx].getHeight() - 1);
        }
        backgrounds[i].translateY(-(int) (scrollSpeed * delta));
    }
}

[Buggy Hunk]
if(backgrounds[i].getY() < -backgrounds[i].getHeight()) {

[Patch]
if(backgrounds[i].getY() <= -backgrounds[i].getHeight() + scrollSpeed * (1.2f * delta)) {