[Demonstration 1]

[Buggy Method]
public T findByRowId(String databaseName, long rowId) {
    return findBySelection(databaseName, getPrimaryKey() + "=" + rowId, null, null);
}

[Buggy Hunk]
return findBySelection(databaseName, getPrimaryKey() + "=" + rowId, null, null);

[Patch]
return findBySelection(databaseName, getPrimaryKey() + "=?", new String[]{String.valueOf(rowId)}, null);

[Demonstration 2]

[Buggy Method]
private boolean checkProgramSlotOverlap(ProgramSlot iProgramSlot) {
    boolean status = false;
    List<AnnualSchedule> annualSchedules = ControlFactory.getScheduleController().getListAnnualSchedule().retrieveAllAnnualSchedules();
    for (int i = 0; i < annualSchedules.size(); i++) {
        AnnualSchedule annSch = annualSchedules.get(i);
        List<WeeklySchedule> weeks = annSch.retrieveAllWeeklySchedules();
        int size2 = weeks.size();
        for (int j = 0; j < size2; ++j) {
            WeeklySchedule week = weeks.get(j);
            List<ProgramSlot> slots = week.retrieveAllProgramSlot();
            int size3 = slots.size();
            for (int k = 0; k < size3; ++k) {
                if (ps2edit == slots.get(k)) {
                    continue;
                } else {
                    status = ScheduleUtility.isProgramSlotOverlap(iProgramSlot, slots.get(k));
                    if (status) {
                        return status;
                    }
                }
            }
        }
    }
    return status;
}

[Buggy Hunk]
if (ps2edit == slots.get(k)) {

[Patch]
if (ps2edit.getID() == slots.get(k).getID()) {

[Demonstration 3]

[Buggy Method]
@Override
public List<Integer> getClientIds() {
    if (!this.isRunning()) {
        throw new RuntimeException("Cannot get ids with a server which is not running");
    }
    return clients.keySet().stream().filter(id -> clients.get(id).isConnected()).collect(Collectors.toList());
}

[Buggy Hunk]
public List<Integer> getClientIds() {

[Patch]
public List<String> getClientIds() {