[Demonstration 1]

[Buggy Method]
@SuppressWarnings("unchecked")
private String toJsonArrayAsString(Iterable<String> items) {
    JSONArray result = new JSONArray();
    items.forEach(item -> result.add(item));
    return result.toJSONString();
}

[Buggy Hunk]
items.forEach(item -> result.add(item));

[Patch]
items.forEach(result::add);

[Demonstration 2]

[Buggy Method]
public void execute() {
    // iterate over users configured to use Killbill
    UserFilterCommand criteria = filterForAccountingType(KILLBILL_ACCOUNTING_VALUE);
    final int max = this.batchSize;
    int offset = 0;
    FilterResults<UserFilterMatch> userResults;
    do {
        userResults = userDao.findFiltered(criteria, null, offset, max);
        for (UserFilterMatch match : userResults) {
            Map<String, Object> billingData = match.getBillingData();
            String accountKey;
            if (billingData.get(KILLBILL_ACCOUNT_KEY_DATA_PROP) instanceof String) {
                accountKey = (String) billingData.get(KILLBILL_ACCOUNT_KEY_DATA_PROP);
            } else {
                // assign account key
                accountKey = "SN" + match.getId();
                userDao.storeBillingDataProperty(match.getId(), KILLBILL_ACCOUNT_KEY_DATA_PROP, accountKey);
            }
            processOneAccount(match, accountKey);
        }
    } while (userResults.getStartingOffset() != null && userResults.getReturnedResultCount() != null && userResults.getTotalResults() != null && (userResults.getStartingOffset() + userResults.getReturnedResultCount() < userResults.getTotalResults()));
}

[Buggy Hunk]
accountKey = "SN" + match.getId();

[Patch]
accountKey = String.format(accountKeyTemplate, match.getId());

[Demonstration 3]

[Buggy Method]
public static void saveDataToDisk(String playerName) throws IOException {
    getConfig().set("Thirst" + DOT + playerName, getThirst(playerName));
    getConfig().save(file);
}

[Buggy Hunk]
getConfig().save(file);

[Patch]
reload();