[Demonstration 1]

[Buggy Method]
public static boolean isEmpty(Object value) {
    if (value == null)
        return true;
    if (value instanceof String) {
        return ((String) value).length() == 0;
    } else if (value instanceof StringBuffer) {
        return ((StringBuffer) value).length() == 0;
    } else if (value instanceof StringBuilder) {
        return ((StringBuilder) value).length() == 0;
    } else if (value instanceof Map) {
        return ((Map) value).isEmpty();
    } else if (value instanceof Collection) {
        return ((Collection) value).isEmpty();
    } else if (Types.isArray(value)) {
        return ((Object[]) value).length == 0;
    }
    return false;
}

[Buggy Hunk]
return ( (Object[]) value).length == 0;

[Patch]
return Array.getLength( value ) == 0;

[Demonstration 2]

[Buggy Method]
public static ArrayList<HashMap<String, String>> findByColumnAndValue(String column, String value) {
    // load data, if not already loaded
    loadData();
    ArrayList<HashMap<String, String>> jobs = new ArrayList<>();
    for (HashMap<String, String> row : allJobs) {
        String aValue = row.get(column);
        if (aValue.contains(value)) {
            jobs.add(row);
        }
    }
    return jobs;
}

[Buggy Hunk]
if (aValue.contains(value)) {

[Patch]
if (aValue.toLowerCase().contains(value)) {

[Demonstration 3]

[Buggy Method]
public static void main(String[] args) {
    Dict d = Dict.createDict();
    String filePath = "resources/dict.txt";
    File dictFile;
    try {
        dictFile = new File(filePath);
        Scanner fileIn = new Scanner(dictFile);
        while (fileIn.hasNext()) {
            d.insert(fileIn.next());
        }
        fileIn.close();
    } catch (Exception e) {
        System.out.println("Error reading file! Aborting...");
        System.exit(0);
    }
    System.out.print(">>> ");
    Scanner userIn = new Scanner(System.in);
    while (userIn.hasNext()) {
        ArrayList<String> results = d.search(userIn.next(), 1);
        for (int i = 0; i < results.size(); ++i) {
            System.out.println(results.get(i));
        }
        System.out.print(">>> ");
    }
}

[Buggy Hunk]
ArrayList<String> results = d.search(userIn.next(), 1);

[Patch]
ArrayList<String> results = d.searchWithEditDist(userIn.next(), 2);