[Demonstration 1]

[Buggy Method]
@Override
protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
    String[] allTerms = value.toString().split("\\s+");
    for (int i = 0; i < allTerms.length; i++) {
        String term = allTerms[i];
        for (int j = i + 1; j < allTerms.length; j++) {
            if (term.equals(allTerms[j]))
                break;
            Pair keyTerm = new Pair(term, allTerms[j]);
            Pair starTerm = new Pair(term, "*");
            if (!map.containsKey(starTerm)) {
                map.put(starTerm, i);
            } else {
                map.put(starTerm, map.get(starTerm) + 1);
            }
            if (!map.containsKey(keyTerm)) {
                map.put(keyTerm, 1);
            } else {
                map.put(keyTerm, map.get(keyTerm) + 1);
            }
        }
    }
    for (Map.Entry<Pair, Integer> entry : map.entrySet()) {
        context.write(entry.getKey(), new IntWritable(entry.getValue()));
    }
}

[Buggy Hunk]
map.put(starTerm, i);

[Patch]
map.put(starTerm, 1);

[Demonstration 2]

[Buggy Method]
@Override
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
    String context = request.getContextPath();
    if (context == null || context.equals("")) {
        modelAndView.addObject("contextPath", context);
    }
}

[Buggy Hunk]
if(context==null||context.equals("")){

[Patch]
if(context!=null&&!context.equals("")){

[Demonstration 3]

[Buggy Method]
public void removeRareAttributes(boolean auto) {
    int option = 0;
    this.df = regroupDFJoint().getDFJoint();
    List<RareElement> rareAttrVector = findRareAttributes();
    while (rareAttrVector.size() != 0) {
        if (!auto) {
            // option = get.stdin(), user specifies what to remove.
        }
        removeAttribute(rareAttrVector.get(option));
        rareAttrVector = findRareAttributes();
    }
}

[Buggy Hunk]
while (rareAttrVector.size() != 0) {

[Patch]
while (!rareAttrVector.isEmpty()) {