[Demonstration 1]

[Buggy Method]
protected int ctGetFunctionalUnits() {
    StringBuffer retData = new StringBuffer();
    HBCIUtilsInternal.getCallback().callback(this, HBCIServerCallback.CT_GET_FUNCTIONAL_UNITS, "getFunctionalUnits", HBCICallback.TYPE_TEXT, retData);
    String result = retData.toString();
    if (result == "<error>")
        throw new CTException("error while reading reader information");
    return Integer.parseInt(result);
}

[Buggy Hunk]
if(result == "<error>") throw new CTException("error while reading reader information");

[Patch]
if(result.equals("<error>")) throw new CTException("error while reading reader information");

[Demonstration 2]

[Buggy Method]
protected DataInfo[] getAllPartitionDataInfos() {
    String[] allPartitions = getAllSubFolders((String) arguments.get("partitionPath"));
    int number = allPartitions.length;
    if ((int) arguments.get("numPartition") < number)
        number = (int) arguments.get("numPartition");
    DataInfo[] dataInfos = new DataInfo[number];
    for (int i = 0; i < number; i++) {
        File dataFile = new File(allPartitions[i], (String) arguments.get("dataFile") + ".json");
        File metaFile = new File(allPartitions[i], (String) arguments.get("dataFile") + ".meta");
        if (!dataFile.exists() || !dataFile.isFile())
            throw new IllegalArgumentException("Invalid partition data file " + dataFile.getAbsolutePath());
        if (!metaFile.exists() || !metaFile.isFile())
            throw new IllegalArgumentException("Invalid partition meta file " + metaFile.getAbsolutePath());
        dataInfos[i] = new DataInfo(dataFile.getAbsolutePath(), metaFile.getAbsolutePath(), (String) arguments.get("keyField"), (long) arguments.get("docToLoad"));
    }
    return dataInfos;
}

[Buggy Hunk]
if ((int)arguments.get("numPartition") < number)

[Patch]
if (arguments.containsKey("numPartition") && (int)arguments.get("numPartition") < number)

[Demonstration 3]

[Buggy Method]
public IssueDoc getByKey(String key) {
    IssueDoc value = getNullableByKey(key);
    if (value == null) {
        throw new NotFoundException(String.format("Issue with key '%s' does not exist", key));
    }
    return value;
}

[Buggy Hunk]
throw new NotFoundException(String.format("Issue with key '%s' does not exist", key));

[Patch]
throw new NotFoundException(format("Issue with key '%s' does not exist", key));