[Demonstration 1]

[Buggy Method]
private Node lrRotate(Node x, Node y, Node z) {
    Node root = null;
    Node zp = z.getParent();
    if (zp == null) {
        root = x;
    } else {
        if (zp.getLeftChild() == z) {
            zp.setLeftChild(x);
        } else {
            zp.setRightChild(x);
        }
    }
    x.setParent(zp);
    if (x.getLeftChild() != null) {
        y.setRightChild(x.getLeftChild());
        x.getLeftChild().setParent(y);
    } else {
        y.setRightChild(null);
    }
    x.setLeftChild(y);
    y.setParent(x);
    if (x.getRightChild() != null) {
        z.setLeftChild(y.getRightChild());
        y.getRightChild().setParent(z);
    } else {
        z.setLeftChild(null);
    }
    x.setRightChild(z);
    z.setParent(x);
    return root;
}

[Buggy Hunk]
if (x.getRightChild() != null) {

[Patch]
if (y.getRightChild() != null) {

[Demonstration 2]

[Buggy Method]
@SuppressWarnings("unchecked")
private String toJsonArrayAsString(Iterable<String> items) {
    JSONArray result = new JSONArray();
    items.forEach(item -> result.add(item));
    return result.toJSONString();
}

[Buggy Hunk]
items.forEach(item -> result.add(item));

[Patch]
items.forEach(result::add);

[Demonstration 3]

[Buggy Method]
@Override
public boolean equals(Object o) {
    if (this == o) {
        return true;
    }
    if (o == null || getClass() != o.getClass()) {
        return false;
    }
    BaseEntity that = (BaseEntity) o;
    return id != null && id.equals(that.id);
}

[Buggy Hunk]
return id != null && id.equals(that.id);

[Patch]
return getId() != null && getId().equals(that.getId());