[Demonstration 1]

[Buggy Method]
public void getHistoricalPrices(String quote, String period, CallBack callback) {
    RequestParams params = new RequestParams("q", quote);
    params.put("p", period);
    String cacheKey = "historicalCahce" + quote + period;
    if (historicalCache.containsKey(cacheKey)) {
        callback.historicalCallBack(historicalCache.get(cacheKey));
        return;
    }
    client.get(ted7726QuoteHistoricalURL, params, historicalPricesHandler(callback, cacheKey));
}

[Buggy Hunk]
RequestParams params = new RequestParams("q", quote);

[Patch]
RequestParams params = new RequestParams("q", Utils.symbolToYahoo(quote));

[Demonstration 2]

[Buggy Method]
@Test
public void save_assignsIdToObject() {
    Client myClient = new Client("Client1");
    myClient.save();
    Client savedClient = Client.all().get(0);
    assertEquals(myClient.getClientId(), savedClient.getClientId());
}

[Buggy Hunk]
assertEquals(myClient.getClientId(), savedClient.getClientId());

[Patch]
assertEquals(myClient.getId(), savedClient.getId());

[Demonstration 3]

[Buggy Method]
@FXML
@Override
public void initialize(URL location, ResourceBundle resources) {
    try {
        User user = Main.getLoginUser();
        List<User> grantable = DatabaseHelper.getUserDao().queryForAll();
        grantable.remove(User.admin());
        grantable.remove(user);
        userComboBox.getItems().addAll(grantable);
        userComboBox.getSelectionModel().select(0);
        final Dao<AccessRecord, Integer> accessRecordDao = DatabaseHelper.getAccessRecordDao();
        List<AccessRecord> controllable = accessRecordDao.queryForMatching(new AccessRecord(user, null, AccessType.CONTROL, null));
        objectComboBox.getItems().addAll(controllable.stream().map(AccessRecord::getObject).collect(Collectors.toList()));
        objectComboBox.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> {
            try {
                List<AccessRecord> records = accessRecordDao.queryForMatching(new AccessRecord(user, newValue, null, null));
                List<AccessType> types = records.stream().map(AccessRecord::getAccessType).collect(Collectors.toList());
                //                    types.remove(AccessType.CONTROL);// type1: center
                permissionChoiceBox.getItems().addAll(types);
                permissionChoiceBox.getSelectionModel().select(0);
            } catch (SQLException e) {
                e.printStackTrace();
            }
        });
    } catch (SQLException e) {
        e.printStackTrace();
    }
}

[Buggy Hunk]
permissionChoiceBox.getItems().addAll(types);

[Patch]
permissionChoiceBox.getItems().setAll(types);