[Demonstration 1]

[Buggy Method]
private boolean aggregableWithScript(UnderlayItem newItem, UnderlayItem topoStoreItem) {
    ScriptResult scriptResult = new ScriptResult();
    scriptEngine.put("aggregable", scriptResult);
    scriptEngine.put("originalItem", topoStoreItem);
    scriptEngine.put("newItem", newItem);
    try {
        scriptEngine.eval(script);
        return scriptResult.getResult();
    } catch (ScriptException e) {
        throw new IllegalStateException("Exception during script evaluation: " + script, e);
    }
}

[Buggy Hunk]
private boolean aggregableWithScript(UnderlayItem newItem, UnderlayItem topoStoreItem) {

[Patch]
private synchronized boolean aggregableWithScript(UnderlayItem newItem, UnderlayItem topoStoreItem) {

[Demonstration 2]

[Buggy Method]
public final void reloadData(final FavoritesDTO favoritesDTO) {
    boolean error = false;
    if (!favoritesDTO.isBikeError()) {
        // Put into intent new bike stations data
        activity.getIntent().putParcelableArrayListExtra(getString(R.string.bundle_bike_stations), (ArrayList<BikeStation>) favoritesDTO.getBikeStations());
        this.bikeStations = favoritesDTO.getBikeStations();
    } else {
        error = true;
    }
    if (!favoritesDTO.isBusError()) {
        favoritesAdapter.setBusArrivals(favoritesDTO.getBusArrivals());
    } else {
        error = true;
    }
    if (!favoritesDTO.isTrainError()) {
        favoritesAdapter.setTrainArrivals(favoritesDTO.getTrainArrivals());
    } else {
        error = true;
    }
    favoritesAdapter.setFavorites();
    favoritesAdapter.refreshUpdated();
    favoritesAdapter.refreshUpdatedView();
    favoritesAdapter.notifyDataSetChanged();
    // Highlight background
    rootView.setBackgroundResource(R.drawable.highlight_selector);
    rootView.postDelayed(() -> rootView.setBackgroundResource(R.drawable.bg_selector), 100);
    stopRefreshing();
    if (error) {
        Util.showMessage(activity, R.string.message_something_went_wrong);
    }
}

[Buggy Hunk]
this.bikeStations = favoritesDTO.getBikeStations();

[Patch]
bikeStations = favoritesDTO.getBikeStations();

[Demonstration 3]

[Buggy Method]
void editBook(String name) {
    try {
        String oldName = name.substring(0, name.indexOf(" ") - 1);
        String newName = name.substring(name.indexOf(" ") + 2, name.length());
        Book book = getBook(oldName);
        if (book != null) {
            System.out.println("Book " + book.toString() + " was edited to \"" + newName + "\". ");
            book.setName(newName);
            bookService.updateBook(book);
        }
    } catch (StringIndexOutOfBoundsException ex) {
        System.out.println("Input is not correct. ");
    }
}

[Buggy Hunk]
System.out.println("Input is not correct. ");

[Patch]
System.out.println("Do you mean - edit \"old book`s name\" \"new book`s name\" ?");