[Demonstration 1]

[Buggy Method]
private LocalDate getBelowStartDate(PhasePaneWrapper phase) {
    LocalDate date = null;
    PhasePaneWrapper below = getPhaseBelow(phase);
    if (below == null)
        return null;
    if (!phase.isSubPhase() && below.isSubPhase()) {
        date = getBelowStartDate(below);
    } else if (phase.isSubPhase() && !below.isSubPhase() && !subPhases.get(below).isEmpty()) {
        date = getBelowStartDate(below);
    } else {
        date = below.getPhaseBegin();
    }
    return date;
}

[Buggy Hunk]
}else if(phase.isSubPhase() && !below.isSubPhase() && !subPhases.get(below).isEmpty()){

[Patch]
}else if(phase.isSubPhase() && !below.isSubPhase() && subPhases.get(below) != null && !subPhases.get(below).isEmpty()){

[Demonstration 2]

[Buggy Method]
public static void spawn(SewerLevel level) {
    if (!Dungeon.isTutorial && !spawned && (Dungeon.depth > 1 && Random.Int(5 - Dungeon.depth) == 0) || Dungeon.template != null) {
        Ghost ghost = new Ghost();
        do {
            ghost.pos = level.randomRespawnCell();
        } while (ghost.pos == -1);
        level.mobs.add(ghost);
        Actor.occupyCell(ghost);
        spawned = true;
        alternative = Random.Int(2) == 0;
        if (!alternative) {
            left2kill = 8;
        }
        given = false;
        processed = false;
        depth = Dungeon.depth;
        do {
            weapon = (Weapon) Generator.random(Generator.Category.WEAPON);
        } while (weapon instanceof MissileWeapon);
        if (Dungeon.isChallenged(Challenges.NO_ARMOR)) {
            armor = (Armor) new ClothArmor().degrade();
        } else {
            armor = (Armor) Generator.random(Generator.Category.ARMOR);
        }
        for (int i = 0; i < 3; i++) {
            Item another;
            do {
                another = Generator.random(Generator.Category.WEAPON);
            } while (another instanceof MissileWeapon);
            if (another.level > weapon.level) {
                weapon = (Weapon) another;
            }
            another = Generator.random(Generator.Category.ARMOR);
            if (another.level > armor.level) {
                armor = (Armor) another;
            }
        }
        weapon.identify();
        armor.identify();
    }
}

[Buggy Hunk]
if (!Dungeon.isTutorial && !spawned && (Dungeon.depth > 1 && Random.Int( 5 - Dungeon.depth ) == 0) || Dungeon.template != null) {

[Patch]
if (!Dungeon.isTutorial && !spawned && (Dungeon.depth > 1 && Random.Int( 5 - Dungeon.depth ) == 0 || Dungeon.template != null)) {

[Demonstration 3]

[Buggy Method]
Dasher init(final PathConsumer2D out, float[] dash, int dashLen, float phase, boolean recycleDashes) {
    if (phase < 0) {
        throw new IllegalArgumentException("phase < 0 !");
    }
    this.out = out;
    // Normalize so 0 <= phase < dash[0]
    int idx = 0;
    dashOn = true;
    float d;
    while (phase >= (d = dash[idx])) {
        phase -= d;
        idx = (idx + 1) % dashLen;
        dashOn = !dashOn;
    }
    this.dash = dash;
    this.dashLen = dashLen;
    this.startPhase = this.phase = phase;
    this.startDashOn = dashOn;
    this.startIdx = idx;
    this.starting = true;
    needsMoveTo = false;
    firstSegidx = 0;
    this.recycleDashes = recycleDashes;
    // fluent API
    return this;
}

[Buggy Hunk]
if (phase < 0) {

[Patch]
if (phase < 0f) {