[Demonstration 1]

[Buggy Method]
@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }
    if (obj == null) {
        return false;
    }
    if (!(obj instanceof ProtocolAttachmentType)) {
        return false;
    }
    AwardAttachmentType other = (AwardAttachmentType) obj;
    if (this.typeCode == null) {
        if (other.typeCode != null) {
            return false;
        }
    } else if (!this.typeCode.equals(other.typeCode)) {
        return false;
    }
    if (this.description == null) {
        if (other.description != null) {
            return false;
        }
    } else if (!this.description.equals(other.description)) {
        return false;
    }
    return true;
}

[Buggy Hunk]
if (!(obj instanceof ProtocolAttachmentType)) {

[Patch]
if (!(obj instanceof AwardAttachmentType)) {

[Demonstration 2]

[Buggy Method]
private String interpretSV0Message(LocoNetMessage l) {
    int dst_h = l.getElement(4);
    int pxct1 = l.getElement(5);
    int pxct2 = l.getElement(10);
    if ((dst_h != 0x01) || ((pxct1 & 0xF0) != 0x00) || ((pxct2 & 0xF0) != 0x00)) {
        return "";
    }
    // (Jabour/Deloof LocoIO), SV Programming messages format 1
    int dst_l = l.getElement(3);
    int[] d = l.getPeerXfrData();
    int src = l.getElement(2);
    String src_subaddrx = ((d[4] != 0) ? "/" + Integer.toHexString(d[4]) : "");
    String dst_subaddrx = (dst_h != 0x01 ? "" : ((d[4] != 0) ? "/" + Integer.toHexString(d[4]) : ""));
    String src_dev = ((src == 0x50) ? "Locobuffer" : "LocoIO@" + "0x" + Integer.toHexString(src) + src_subaddrx);
    String dst_dev = (((dst_h == 0x01) && (dst_l == 0x50)) ? "LocoBuffer " : (((dst_h == 0x01) && (dst_l == 0x0)) ? "broadcast" : "LocoIO@0x" + Integer.toHexString(dst_l) + dst_subaddrx));
    String operation = (src == 0x50) ? ((d[0] == 2) ? "Query" : "Write") : ((d[0] == 2) ? "Report" : "Write");
    return src_dev + "=> " + dst_dev + " " + ((dst_h == 0x01) ? (operation + " SV" + d[1]) : "") + ((src == 0x50) ? (d[0] != 2 ? ("=0x" + Integer.toHexString(d[3])) : "") : " = " + ((d[0] == 2) ? ((d[2] != 0) ? (d[5] < 10) ? "" + d[5] : d[5] + " (0x" + Integer.toHexString(d[5]) + ")" : (d[7] < 10) ? "" + d[7] : d[7] + " (0x" + Integer.toHexString(d[7]) + ")") : (d[7] < 10) ? "" + d[7] : d[7] + " (0x" + Integer.toHexString(d[7]) + ")")) + ((d[2] != 0) ? " Firmware rev " + dotme(d[2]) : "") + ".\n";
}

[Buggy Hunk]
+ ((dst_h == 0x01) ? (operation + " SV" + d[1]) : "")

[Patch]
+ operation + " SV" + d[1]

[Demonstration 3]

[Buggy Method]
@Override
public boolean equals(Object obj) {
    if (this == obj)
        return true;
    if (obj == null)
        return false;
    if (getClass() != obj.getClass())
        return false;
    InstantMessage other = (InstantMessage) obj;
    if (from == null) {
        if (other.from != null)
            return false;
    } else if (!from.equals(other.from))
        return false;
    if (to == null) {
        if (other.to != null)
            return false;
    } else if (!to.equals(other.to))
        return false;
    return true;
}

[Buggy Hunk]
InstantMessage other = (InstantMessage)obj;

[Patch]
FriendInvitation other = (FriendInvitation)obj;