[Demonstration 1]

[Buggy Method]
public static void execute(String content) throws ScriptException, NoSuchMethodException, InvalidOperationException {
    //Initialising rail wires.. Powering up circuit :P
    {
        rootNode = new BnBNode(null, null);
        highWire.assignment = FvLogic.high;
        lowWire.assignment = FvLogic.low;
        highWire.assignment_node = rootNode;
        lowWire.assignment_node = rootNode;
        all_nets.put(0, lowWire);
        all_nets.put(1, highWire);
    }
    //Parsing the circuit
    {
        ScriptEngine engine = new ScriptEngineManager().getEngineByName("nashorn");
        ScriptObjectMirror mirror = (ScriptObjectMirror) engine.eval("load('src/com/verification/parse.js')");
        Invocable invocable = (Invocable) engine;
        Object result = invocable.invokeFunction("create_schema", content);
        ((Map) engine.eval("all_nets")).forEach((key, value) -> {
            wire newWire = new wire(((Number) value).intValue());
            global.all_nets.put(((Number) value).intValue(), newWire);
        });
        ((Map) engine.eval("all_components")).forEach((key, value) -> {
            try {
                ArrayList<Number> in_temp = new ArrayList<>(((Map) (((Map) value).get("inputs"))).values());
                ArrayList<Number> out_temp = new ArrayList<>(((Map) (((Map) value).get("outputs"))).values());
                ArrayList<Integer> in = new ArrayList<>();
                ArrayList<Integer> out = new ArrayList<>();
                in_temp.forEach((number) -> {
                    in.add(new Integer(number.intValue()));
                    all_nets.get(new Integer(number.intValue())).outputgate_id = new Integer((String) key);
                });
                out_temp.forEach((number) -> {
                    out.add(new Integer(number.intValue()));
                    all_nets.get(new Integer(number.intValue())).inputgate_id = new Integer((String) key);
                });
                component gate;
                switch((((Map) value).get("type")).toString()) {
                    case "PI":
                        gate = new PI(Integer.parseInt((String) key), in, out);
                        break;
                    case "PO":
                        gate = new PO(Integer.parseInt((String) key), in, out);
                        break;
                    case "and_gate":
                        gate = new and_gate(Integer.parseInt((String) key), in, out);
                        break;
                    case "or_gate":
                        gate = new or_gate(Integer.parseInt((String) key), in, out);
                        break;
                    case "not_gate":
                        gate = new not_gate(Integer.parseInt((String) key), in, out);
                        break;
                    case "fanout_gate":
                        gate = new fanout_gate(Integer.parseInt((String) key), in, out);
                        break;
                    default:
                        throw new InvalidOperationException();
                }
                all_components.put(Integer.parseInt((String) key), gate);
            } catch (InvalidOperationException e) {
                e.printStackTrace();
            }
        });
    }
    //Setting up controllability
    all_components.forEach((id, component) -> {
        if (component instanceof PI) {
            component.check_and_propogate_controllability();
        }
    });
    if (!check_controllability_completion())
        throw new RuntimeException();
    //Initialising fault list
    all_nets.forEach((key, value) -> {
        if (key != 1 && key != 0) {
            Allsa0faults.put(key, "");
            Allsa1faults.put(key, "");
        }
    });
    Integer faultSite = getNextFault();
    //Algorithm start
    do {
        BnBStack podemStack = new BnBStack(faultSite);
        podemStack.execute();
        String solution = "";
        for (component inputComponent : all_components.values()) {
            if (inputComponent instanceof PI) {
                solution += inputComponent.hashID + ": " + ((PI) inputComponent).assignment + ", ";
            }
        }
        if (all_nets.get(faultSite).assignment == FvLogic.D)
            Allsa0faults.put(faultSite, solution);
        else
            Allsa1faults.remove(faultSite, solution);
        resetWires();
        faultSite = getNextFault();
    } while (faultSite != null);
}

[Buggy Hunk]
Allsa1faults.remove(faultSite,solution);

[Patch]
Allsa1faults.put(faultSite,solution);

[Demonstration 2]

[Buggy Method]
public void draw() {
    //move and show the bacteria
    background(bacteria.bacteriaColor, 0, 0);
    for (int i = 0; i < bob.length; i++) {
        bob[i].show();
        bob[i].move();
        //System.out.println("ok");
    }
}

[Buggy Hunk]
background(bacteria.bacteriaColor, 0, 0);

[Patch]
background(0, 0, 0);

[Demonstration 3]

[Buggy Method]
public static void main(String[] args) throws SQLException {
    Connection conn = DriverManager.getConnection("jdbc:h2:./main");
    () -> {
    }.start();
    Statement stmt = conn.createStatement();
    stmt.execute("CREATE TABLE id IDENTITY, username VARCHAR, address VARCHAR, email VARCHAR");
}

[Buggy Hunk]
().start();

[Patch]
Server.createWebServer().start();