[Demonstration 1]

[Buggy Method]
@Override
public int getItemCount() {
    return mStoryList.size() + mIndexMap.size() + 2;
}

[Buggy Hunk]
return mStoryList.size() + mIndexMap.size() + 2;

[Patch]
return mStoryList.size() + mIndexMap.size() + 2 - mIndexMap.size() - 1;

[Demonstration 2]

[Buggy Method]
@Override
public void enterStmt(SRLParser.StmtContext ctx) {
    visit(ctx.flag(), this::enterFlag);
    visit(ctx.anchor(), this::enterAnchor);
    if (ctx.if_stmt() != null)
        enterConditionalStmt(ctx.if_stmt(), ctx.stmt());
    visit(ctx.quantifiable_stmt(), this::enterQuantifiable_stmt);
    visit(ctx.quantifier(), this::enterQuantifier);
}

[Buggy Hunk]
if(ctx.if_stmt() != null) enterConditionalStmt(ctx.if_stmt(), ctx.stmt());

[Patch]
if(ctx.if_stmt() != null) enterConditionalStmt(ctx.if_stmt(), ctx.stmt(), this::enterStmt);

[Demonstration 3]

[Buggy Method]
public void SearchProduct(String barcodeScanResult, String barcodeFormatName, String itemId, final Context ctx) {
    TescoApi testApi = new TescoApi();
    final TescoService testService = testApi.getService();
    final String searchText = (barcodeScanResult != null && barcodeScanResult.isEmpty()) ? barcodeScanResult : itemId;
    testService.productSearch(searchText, new retrofit.Callback<TescoProductSearch>() {

        @Override
        public void success(final TescoProductSearch result, Response response) {
            if (result != null && result.getStatusCode() != null && result.getStatusCode() == 0 && result.getTotalProductCount() != null && result.getTotalProductCount() > 0 && result.getProducts() != null && result.getProducts().size() > 0) {
                final Product prod = new Product(result.getProducts().get(0));
                TescoApi descriptionApi = new TescoApi();
                TescoService descriptionService = descriptionApi.getService();
                testService.productExtendedInfo(result.getProducts().get(0).getProductId(), new retrofit.Callback<Response>() {

                    @Override
                    public void success(final Response result, Response response) {
                        String test = new String(((TypedByteArray) result.getBody()).getBytes());
                        String divTag = "<div class=\"content\">";
                        String divEndTag = "</div>";
                        if (test.indexOf(divTag) > -1) {
                            int divIndex = test.indexOf(divTag) + divTag.length();
                            if (test.substring(divIndex).indexOf(divEndTag) > -1) {
                                int divEndIndex = test.substring(divIndex).indexOf(divEndTag) + divIndex;
                                prod.setDescription(Jsoup.parse(test.substring(divIndex, divEndIndex)).text().replaceAll("\\<.*?\\>", ""));
                            }
                        }
                        Bundle bundle = new Bundle();
                        bundle.putParcelable(DetailActivity.PRODUCT_PARCELABLE, prod);
                        Intent intent = new Intent(ctx, DetailActivity.class);
                        intent.putExtra(DetailActivity.PRODUCT_PARCELABLE, bundle);
                        ctx.startActivity(intent);
                    }

                    @Override
                    public void failure(final RetrofitError error) {
                        String msg = error.getMessage();
                        Toast.makeText(ctx, msg, Toast.LENGTH_LONG).show();
                    }
                });
            } else {
                Toast.makeText(ctx, "Product not found for : " + searchText, Toast.LENGTH_LONG).show();
            }
        }

        @Override
        public void failure(final RetrofitError error) {
            String msg = error.getMessage();
            Toast.makeText(ctx, msg, Toast.LENGTH_LONG).show();
        }
    });
}

[Buggy Hunk]
final String searchText = (barcodeScanResult != null && barcodeScanResult.isEmpty()) ? barcodeScanResult : itemId ;

[Patch]
final String searchText = (barcodeScanResult != null && !barcodeScanResult.isEmpty()) ? barcodeScanResult : itemId ;