[Demonstration 1]

[Buggy Method]
@Override
public RegressionModel findOne(Long id) {
    final List<RegressionModel> models = new ArrayList<>();
    jdbcTemplate.query(SELECT_MODEL + id, new RowCallbackHandler() {

        @Override
        public void processRow(ResultSet rs) throws SQLException {
            RegressionModel m = new RegressionModel();
            try {
                m.deserializeClassifierFromJson(rs.getString(1));
                m.setLongId(rs.getLong(2));
                m.setGeneratedOn(rs.getDate(3));
                models.add(m);
            } catch (IOException e) {
                throw new SQLException("Unable to deserialze model from string", e);
            }
        }
    });
    return models.get(0);
}

[Buggy Hunk]
return models.get(0);

[Patch]
return models.isEmpty() ? null : models.get(0);

[Demonstration 2]

[Buggy Method]
List<Listener> listeners(String event) {
    LinkedList<Listener> callbacks = this.callbacks.get(event);
    return callbacks != null ? new ArrayList<>(callbacks) : new ArrayList<>(0);
}

[Buggy Hunk]
new ArrayList<>(callbacks) : new ArrayList<>(0);

[Patch]
new ArrayList<Listener>(callbacks) : new ArrayList<Listener>(0);

[Demonstration 3]

[Buggy Method]
public void forfeit(JdbConnection jdbConnection) throws ConnectionPoolException {
    if (borrowed.containsKey(jdbConnection)) {
        borrowed.remove(jdbConnection);
        pool.add(jdbConnection);
    }
}

[Buggy Hunk]
public void forfeit(JdbConnection jdbConnection) throws ConnectionPoolException {

[Patch]
public void forfeit(JdbConnection jdbConnection) {