[Demonstration 1]

[Buggy Method]
private static String Function(double x, String function) {
    DecimalFormat df = new DecimalFormat("#.00000000");
    x = Double.parseDouble(df.format(x));
    String function1 = functionStr(function, x);
    ScriptEngineManager evalFunction = new ScriptEngineManager();
    ScriptEngine evaluate = evalFunction.getEngineByName("js");
    Object result = null;
    try {
        //System.out.println(function1 + "FUNCTION");
        result = evaluate.eval(function1);
    } catch (ScriptException e) {
        System.out.println("Function not valid please ensure equation is correct " + "\n Ex: 2-(-x) != 2--x ; 2x^3+3/4 != ((2x^3)+3)/4" + " " + function1);
        System.exit(0);
    }
    //System.out.println(df.format(Double.parseDouble(result.toString())) + " HERE");
    return result.toString();
}

[Buggy Hunk]
System.exit(0);

[Patch]
System.exit(105);

[Demonstration 2]

[Buggy Method]
public void print() {
    System.out.print("\n" + getName());
    System.out.println(", " + getDescription());
    System.out.println("---------------------");
    Iterator iterator = menuComponent.iterator();
    while (iterator.hasNext()) {
        MenuComponent menuComponent = (MenuComponent) iterator.next();
        menuComponent.print();
    }
}

[Buggy Hunk]
Iterator iterator = menuComponent.iterator();

[Patch]
Iterator iterator = menuComponents.iterator();

[Demonstration 3]

[Buggy Method]
@Override
public boolean isActive() {
    try {
        Mongo mon = this.createNewMongo();
        return mon != null;
    } catch (Exception e) {
        log.error("Error in checking Mongo config availability", e);
        return false;
    }
}

[Buggy Hunk]
Mongo mon = this.createNewMongo();

[Patch]
Mongo mon = this.createNewMongo(getProperties());