[Demonstration 1]

[Buggy Method]
@Override
public boolean removeAll(Collection<?> c) {
    Iterator<?> iter = c.iterator();
    boolean isChanged = false;
    while (iter.hasNext()) {
        Object item = iter.next();
        if (map.containsKey(item)) {
            map.remove(iter.next());
            isChanged = true;
        }
    }
    return isChanged;
}

[Buggy Hunk]
map.remove(iter.next());

[Patch]
map.remove(item);

[Demonstration 2]

[Buggy Method]
@Lazy
public static <T> Iterator<T> cons(Supplier<T> head, Supplier<Iterator<T>> tail) {
    return new Iterator<>() {

        private boolean first = true;

        private Iterator<T> it;

        @Override
        public boolean hasNext() {
            if (first) {
                return true;
            }
            if (it == null) {
                it = tail.get();
            }
            return it.hasNext();
        }

        @Override
        public T next() {
            if (first) {
                first = false;
                return head.get();
            }
            if (it == null) {
                it = tail.get();
            }
            return it.next();
        }
    };
}

[Buggy Hunk]
return new Iterator<>() {

[Patch]
return new Iterator<T>() {

[Demonstration 3]

[Buggy Method]
public QueryResult<List<BillingAccount>> updateBillingAccount(AuthUser user, BillingAccount billingAccount) throws SupplyException {
    // Validate the billing account status and get the corresponding active flag value.
    Long activeFlag = getActiveFlagFromStatusName("billing account", billingAccount.getStatus());
    // validate the provided companyId
    validateCompanyId(billingAccount.getCompanyId());
    billingAccountDAO.updateBillingAccount(billingAccount.getId(), billingAccount.getAmount(), billingAccount.getName(), billingAccount.getPaymentTerms().getId(), billingAccount.getStartDate(), billingAccount.getEndDate(), activeFlag, user.getUserId().getId(), billingAccount.getSalesTax(), billingAccount.getPoNumber(), billingAccount.getDescription(), billingAccount.getSubscriptionNumber(), billingAccount.getCompanyId(), billingAccount.getManualPrizeSetting());
    return billingAccountDAO.getBillingAccount(billingAccount.getId());
}

[Buggy Hunk]
billingAccountDAO.updateBillingAccount(billingAccount.getId(), billingAccount.getAmount(),

[Patch]
billingAccountDAO.updateBillingAccount(billingAccount.getId(), billingAccount.getBudgetAmount(),