[Demonstration 1]

[Buggy Method]
public static double calcFeetAndInchesToCentimeters(double feet, double inches) {
    if ((feet < 0) || (inches < 0) && (inches > 12)) {
        System.out.println("Invalid feet or inches parameters");
        return -1;
    }
    //conversion for centimeters in feet and inches
    double centimeters = (feet * 12) * 2.54;
    centimeters += inches * 2.54;
    System.out.println(feet + " feet " + inches + " inches = " + centimeters + " cm");
    return centimeters;
}

[Buggy Hunk]
if ((feet < 0) || (inches < 0) && (inches > 12)) {

[Patch]
if ((feet < 0) || (inches < 0) || (inches > 12)) {

[Demonstration 2]

[Buggy Method]
public static void main(String[] args) throws IOException {
    new SeamCarvingDemo().runDemo("apple.jpg", 50, 13);
}

[Buggy Hunk]
new SeamCarvingDemo().runDemo("apple.jpg", 50, 13);

[Patch]
new SeamCarvingDemo().runDemo("apple.jpg", 80, 0);

[Demonstration 3]

[Buggy Method]
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public Location newLocation() {
    Vector2 copy = pos.cpy();
    return new Player(copy.add((int) (Math.random() * 50), (int) (Math.random() * 50)), new Vector2());
}

[Buggy Hunk]
return new Player(copy.add((int) (Math.random() * 50), (int) (Math.random() * 50)), new Vector2());

[Patch]
return new Player(copy.add((int) (Math.random() * 50), (int) (Math.random() * 50)), new Vector2(),false);