[Demonstration 1]

[Buggy Method]
public byte[] transform(final byte[] bytes) throws FileTransformException, IOException {
    Workbook wb = new XSSFWorkbook(new ByteArrayInputStream(bytes));
    validateWorkbook(wb);
    return transformData(wb);
}

[Buggy Hunk]
public byte[] transform(final byte[] bytes) throws FileTransformException, IOException {

[Patch]
public byte[] transform(final byte[] bytes) throws IOException {

[Demonstration 2]

[Buggy Method]
public static boolean flip(int size, Random rnd) {
    return rnd.nextDouble() * size < 1;
}

[Buggy Hunk]
return rnd.nextDouble() * size < 1;

[Patch]
return rnd.nextDouble() * size <= 1.0;

[Demonstration 3]

[Buggy Method]
@Override
public void read(byte[] bytes) throws IOException {
    inputStream.read(bytes);
}

[Buggy Hunk]
inputStream.read(bytes);

[Patch]
inputStream.readFully(bytes);