[Demonstration 1]

[Buggy Method]
public static int bytesToInt(ByteOrder order, byte... bytes) {
    if (bytes.length != 4) {
        throw new IllegalArgumentException("Bytes count must be 4");
    }
    ByteBuffer buffer = ByteBuffer.wrap(bytes, 0, 4);
    buffer.order(order);
    return buffer.getShort();
}

[Buggy Hunk]
return buffer.getShort();

[Patch]
return buffer.getInt();

[Demonstration 2]

[Buggy Method]
private void putAux(Node<V> node, int index, String key, V value) {
    if (Character.compare(node.caracter, key.charAt(index)) == 0) {
        if (node.mid == null && index == key.length() - 1) {
            node.value = value;
            return;
        } else if (node.mid == null) {
            node.mid = putAux(key, value, index);
            size++;
            return;
        }
        putAux(node.mid, index + 1, key, value);
    } else if (Character.compare(node.caracter, key.charAt(index)) > 0) {
        if (node.left == null) {
            node.left = putAux(key, value, index);
            size++;
            return;
        }
        putAux(node.left, index, key, value);
    } else {
        if (node.right == null) {
            node.right = putAux(key, value, index);
            size++;
            return;
        }
        putAux(node.right, index, key, value);
    }
}

[Buggy Hunk]
if (node.mid == null && index == key.length() - 1) {

[Patch]
if (index == (key.length() - 1)) {

[Demonstration 3]

[Buggy Method]
public IStringBuffer append(char[] chars, int start, int length) {
    if (chars == null)
        throw new NullPointerException();
    if (start < 0)
        throw new IndexOutOfBoundsException();
    if (length <= 0)
        throw new IndexOutOfBoundsException();
    if (start + length >= chars.length)
        throw new IndexOutOfBoundsException();
    //check the necessary to resize the buffer.
    if (count + length > buff.length)
        resizeTo((count + length) * 2 + 1);
    for (int j = 0; j < length; j++) {
        buff[count++] = chars[start + j];
    }
    return this;
}

[Buggy Hunk]
if ( start + length >= chars.length )

[Patch]
if ( start + length > chars.length )