[Demonstration 1]

[Buggy Method]
public byte[] getBytesForDataResource(DataResource dataResource) throws IOException, InvalidInputException {
    logger.log("Fetching Bytes for Data Item", Severity.INFORMATIONAL, new AuditElement("access", "getBytesForData", dataResource.getDataId()));
    FileLocation fileLocation = ((RasterDataType) dataResource.getDataType()).getLocation();
    FileAccessFactory fileAccessFactory = getFileFactoryForDataResource(dataResource);
    return IOUtils.toByteArray(fileAccessFactory.getFile(fileLocation));
}

[Buggy Hunk]
FileLocation fileLocation = ((RasterDataType) dataResource.getDataType()).getLocation();

[Patch]
FileLocation fileLocation = ((FileRepresentation) dataResource.getDataType()).getLocation();

[Demonstration 2]

[Buggy Method]
public void insert(KeyType key, ValueType value) {
    long startTime = System.nanoTime();
    numInserts++;
    if ((num_of_entries == capacity / 2) && resizable) {
        resize(capacity * 2);
    }
    int index = keyToIndex(key);
    Pair<KeyType, ValueType> pairToCheck;
    while (((pairToCheck = table.get(index)) != null) && (!pairToCheck.key.equals(key))) {
        numCollisions++;
        // Make sure we don't wrap around
        index = step(index);
    }
    /*
		 * We know that we want to insert into this bucket, whether or not we
		 * are there. If our key is the same, it will be overwritten so it's no
		 * big deal to be overwritten by itself.
		 */
    table.set(index, new Pair<KeyType, ValueType>(key, value));
    if (pairToCheck == null) {
        num_of_entries += 1;
    }
    // Resets stepVariable for sub-classes.
    stepVariable = 1;
    totalInsertTime += System.nanoTime() - startTime;
}

[Buggy Hunk]
if ((num_of_entries == capacity / 2) && resizable) {

[Patch]
if ((num_of_entries >= capacity / 2) && resizable) {

[Demonstration 3]

[Buggy Method]
public int[] selectWinner(Player[] players) {
    Gesture[] rightHandGestures = new Gesture[players.length];
    for (int index = 0; index < players.length; ++index) {
        rightHandGestures[index] = players[index].getRightHandGesture();
    }
    int[] firstWinners = this.selectPartialWinner(rightHandGestures);
    if (firstWinners.length <= 1) {
        return firstWinners;
    } else {
        Gesture[] leftHandGestures = new Gesture[firstWinners.length];
        for (int index = 0; index < firstWinners.length; ++index) {
            leftHandGestures[index] = leftHandGestures[firstWinners[index]];
        }
        int[] secondWinners = this.selectPartialWinner(leftHandGestures);
        return secondWinners;
    }
}

[Buggy Hunk]
leftHandGestures[index] = leftHandGestures[firstWinners[index]];

[Patch]
leftHandGestures[index] = players[firstWinners[index]].getLeftHandGesture();