[Demonstration 1]

[Buggy Method]
boolean isContained(final Set<String> set, final String template) {
    if (set != null || template != null) {
        return set.contains(template.toLowerCase(LOCALE));
    }
    return false;
}

[Buggy Hunk]
if (set!=null || template != null) {

[Patch]
if (set!=null && template != null) {

[Demonstration 2]

[Buggy Method]
@Override
public int getItemCount() {
    if (getItemSpanSizeForGrid(-1, -1, -1) == -1) {
        mDisableLoadMore = true;
        return list == null ? 0 : list.size();
    }
    return (list == null) ? 0 : (list.size() + 1);
}

[Buggy Hunk]
if (getItemSpanSizeForGrid(-1, -1, -1) == -1) {

[Patch]
if (getItemSpanSizeForGrid(0, 0, 1) == -1) {

[Demonstration 3]

[Buggy Method]
@Override
public void run() throws Exception {
    Stopwatch sw = new Stopwatch().start();
    long sleepTime = new Random().nextInt(sleepTimeMax);
    if (modeByte == VIA_RPC_BYTE) {
        LOG.info("Received via RPC.");
    } else if (modeByte == VIA_HDFS_DIST_CACHE_BYTE) {
        LOG.info("Reading from local filesystem");
        FileSystem localFs = FileSystem.getLocal(new Configuration());
        FSDataInputStream is = localFs.open(new Path(DISK_PAYLOAD_NAME));
        IOUtils.readFully(is, -1, false);
    } else if (modeByte == VIA_HDFS_DIRECT_READ_BYTE) {
        LOG.info("Reading from HDFS");
        FileSystem fs = FileSystem.get(new Configuration());
        FSDataInputStream is = fs.open(new Path(Path.SEPARATOR + "tmp", DISK_PAYLOAD_NAME));
        IOUtils.readFully(is, -1, false);
    } else {
        throw new IllegalArgumentException("Unknown execution mode: [" + modeByte + "]");
    }
    LOG.info("TimeTakenToAccessPayload=" + sw.stop().elapsedMillis());
    LOG.info("Sleeping for: " + sleepTime);
    Thread.sleep(sleepTime);
}

[Buggy Hunk]
long sleepTime = new Random().nextInt(sleepTimeMax);

[Patch]
long sleepTime = random.nextInt(sleepTimeMax);