[Demonstration 1]

[Buggy Method]
@org.jetbrains.annotations.Nullable
private String filterAd(Element element, SearchParams sp) {
    Elements allTds = element.select("td");
    String linkHref = allTds.get(1).select("a").attr("href");
    String address = allTds.get(3).select("b").get(0).text();
    String rooms = allTds.get(4).select("b").get(0).text();
    String area = allTds.get(5).select("b").get(0).text();
    String floor = allTds.get(6).select("b").get(0).text();
    int cost = Integer.parseInt(allTds.get(9).select("b").get(0).text().replaceAll(",", ""));
    if (sp.getCostBottom() > cost || sp.getCostTop() < cost) {
        return null;
    }
    if (sp.getArea() > Integer.parseInt(area)) {
        return null;
    }
    if (sp.getRooms() > Integer.parseInt(rooms)) {
        return null;
    }
    if (sp.getFloor() > Integer.parseInt(floor)) {
        return null;
    }
    return linkHref;
}

[Buggy Hunk]
int cost = Integer.parseInt(allTds.get(9).select("b").get(0).text().replaceAll(",", ""));

[Patch]
double cost = Double.parseDouble(allTds.get(9).select("b").get(0).text().replaceAll(",", ""));

[Demonstration 2]

[Buggy Method]
static private Token jj_consume_token(int kind) throws ParseException {
    Token oldToken;
    if ((oldToken = token).next != null)
        token = token.next;
    else
        token = token.next = token_source.getNextToken();
    jj_ntk = -1;
    if (token.kind == kind) {
        jj_gen++;
        if (++jj_gc > 100) {
            jj_gc = 0;
            for (int i = 0; i < jj_2_rtns.length; i++) {
                JJCalls c = jj_2_rtns[i];
                while (c != null) {
                    if (c.gen < jj_gen)
                        c.first = null;
                    c = c.next;
                }
            }
        }
        return token;
    }
    token = oldToken;
    jj_kind = kind;
    throw generateParseException();
}

[Buggy Hunk]
static private Token jj_consume_token(int kind) throws ParseException {

[Patch]
private Token jj_consume_token(int kind) throws ParseException {

[Demonstration 3]

[Buggy Method]
@Test
public void testProcessSec() throws ParseException {
    Processor processor = new Processor();
    processor.carry = false;
    processor.processSec();
    Assert.assertTrue(processor.isCarry());
}

[Buggy Hunk]
public void testProcessSec() throws ParseException {

[Patch]
public void testProcessSec() {