[Demonstration 1]

[Buggy Method]
public static int getFirstWordSkipLeadingGreaterSign(byte[] header, byte[] result) {
    int start = (header.length > 0 && header[0] == '>' ? 1 : 0);
    while (start < header.length && Character.isWhitespace(header[start])) {
        start++;
    }
    int end = start;
    while (end < header.length && !Character.isWhitespace(header[end]) && header[end] != 0) {
        end++;
    }
    int length = end - start;
    if (length > 0)
        System.arraycopy(header, start, result, 0, length);
    return length;
}

[Buggy Hunk]
int length = end - start;

[Patch]
int length = Math.min(result.length, end - start);

[Demonstration 2]

[Buggy Method]
Registrar getRegistrarHelper(SipServletMessage message) {
    return (Registrar) message.getAttribute(SC_REGISTER_HELPER);
}

[Buggy Hunk]
return (Registrar) message.getAttribute(SC_REGISTER_HELPER);

[Patch]
return (Registrar) getAppSession(message).getAttribute(SC_REGISTER_HELPER);

[Demonstration 3]

[Buggy Method]
public static boolean isNotEmpty(Object[] array) {
    return !ArrayUtils.isNotEmpty(array);
}

[Buggy Hunk]
return !ArrayUtils.isNotEmpty(array);

[Patch]
return !ArrayUtils.isEmpty(array);