[Demonstration 1]

[Buggy Method]
public boolean isNg() {
    if (yahoo_auction_hit_count != null && yahoo_auction_hit_count == 0) {
        return true;
    }
    if (newPrice2() < 5000) {
        return true;
    }
    if (title.contains("レンタル落ち") || title.contains("VHS")) {
        return true;
    }
    if (total_used > 20) {
        return true;
    }
    if ((lowest_used_price != null && newPrice2() != null) && newPrice2() < lowest_used_price * 2) {
        return true;
    }
    if (sales_price != null && sales_price < 0) {
        return true;
    }
    if (sales_rank > 50000) {
        return true;
    }
    return false;
}

[Buggy Hunk]
if (sales_rank > 50000) {

[Patch]
if (sales_rank != null && sales_rank > 50000) {

[Demonstration 2]

[Buggy Method]
public boolean isValid() {
    switch(type) {
        case NORMAL:
            return isRealmClassValid() && isFieldDataValid() && isTransformerValid() && areArgsValid();
        case NO_ARG:
        case BEGIN_GROUP:
        case END_GROUP:
        case OR:
            return isRealmClassValid() && isTransformerValid() && areArgsValid();
        default:
            return false;
    }
}

[Buggy Hunk]
return isRealmClassValid() && isTransformerValid() && areArgsValid();

[Patch]
return isRealmClassValid() && isTransformerValid();

[Demonstration 3]

[Buggy Method]
public boolean addLab(Lab lab) {
    try {
        labDAO.persist(lab);
        return true;
    } catch (Exception e) {
        e.printStackTrace();
        return false;
    }
}

[Buggy Hunk]
labDAO.persist(lab);

[Patch]
labDAO.attachDirty(lab);