[Demonstration 1]

[Buggy Method]
public static void RetrieveGame(Game game, String name) throws IOException {
    File f = new File("Games\\" + name + "\\" + game.getName() + "\\info.txt");
    ObjectInputStream in = new ObjectInputStream(new FileInputStream(f));
    game = (Game) in.readObject();
    in.close();
}

[Buggy Hunk]
public static void RetrieveGame(Game game, String name) throws IOException {

[Patch]
public static void RetrieveGame(Game game, String name) throws IOException, ClassNotFoundException {

[Demonstration 2]

[Buggy Method]
@Override
public void runOpMode() throws InterruptedException {
    final RobotHardware hardware = new RobotHardware();
    hardware.initialize(hardwareMap);
    AutoFunctions autoFunctions = new AutoFunctions(hardware, this);
    waitForStart();
    int gyroHeading = hardware.getTurretGyro().getIntegratedZValue();
    while (opModeIsActive() && hardware.getTurretGyro().isCalibrating()) ;
    hardware.getTurretGyro().resetZAxisIntegrator();
    autoFunctions.twoWheelTurn(-30);
    hardware.setDrivePower(-.3, -.4);
    LinearOpModeTimeOutFunc timer = new LinearOpModeTimeOutFunc(this, 2);
    while (timer.value() && Math.abs(hardware.getTurretGyro().getIntegratedZValue() - gyroHeading + 45) > 1) {
        telemetry.addData("Gyro Heading", hardware.getTurretGyro().getIntegratedZValue());
    }
    hardware.stopDrive();
    sleep(500);
    hardware.setDrivePower(-.35, -.3);
    sleep(1000);
    hardware.stopDrive();
}

[Buggy Hunk]
autoFunctions.twoWheelTurn(-30);

[Patch]
autoFunctions.twoWheelTurnPID(30, AutoFunctions.TurnDirection.RIGHT);

[Demonstration 3]

[Buggy Method]
private static File createFileFromInputStream(InputStream inputStream, String encoding) {
    final File file;
    final File tempDir = FileHelper.getTempDir();
    File fileCandidate = null;
    boolean usableName = false;
    int index = 0;
    while (!usableName) {
        index++;
        fileCandidate = new File(tempDir, "metamodel" + index + ".csv");
        usableName = !fileCandidate.exists();
    }
    file = fileCandidate;
    final BufferedWriter writer = FileHelper.getBufferedWriter(file, encoding);
    final BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
    try {
        file.createNewFile();
        file.deleteOnExit();
        boolean firstLine = true;
        for (String line = reader.readLine(); line != null; line = reader.readLine()) {
            if (firstLine) {
                firstLine = false;
            } else {
                writer.write('\n');
            }
            writer.write(line);
        }
    } catch (IOException e) {
        throw new IllegalStateException(e);
    } finally {
        FileHelper.safeClose(writer, reader);
    }
    return file;
}

[Buggy Hunk]
final BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));

[Patch]
final BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, Charset.forName(encoding)));