[Demonstration 1]

[Buggy Method]
public static void loadPage(Socket clientSocket, String filePath, BufferedReader br) {
    try {
        PrintWriter output = new PrintWriter(clientSocket.getOutputStream());
        File file = new File(filePath);
        if (!file.exists()) {
            output.write("HTTP/1.1 404 Not Found\r\n");
            System.out.println("File does not exist.  Client requesting file at : " + filePath);
            output.close();
        } else {
            output.write("HTTP/1.1 200 OK\r\n" + "Content-Type: text/html" + "\r\n\r\n");
            byte[] fileBytes = Files.readAllBytes(Paths.get(filePath));
            String fileString = new String(fileBytes, StandardCharsets.UTF_8);
            output.write(fileString);
            System.out.println("Finished writing content to output");
            //brFile.close();
            //br.close();
            output.close();
        }
    } catch (IOException e) {
        System.out.println("Connection: " + e.getMessage());
    }
}

[Buggy Hunk]
output.write("HTTP/1.1 404 Not Found\r\n");

[Patch]
output.write("HTTP/1.1 404 Not Found\r\n" + "Content-Type: text/html" + "\r\n\r\n");

[Demonstration 2]

[Buggy Method]
@Test
public void statusCodeForSuccessfulGET() {
    HTTPHeader header = new HTTPHeader();
    assertEquals("HTTP/1.1 200 OK\n", header.statusCode);
}

[Buggy Hunk]
assertEquals("HTTP/1.1 200 OK\n", header.statusCode);

[Patch]
assertEquals("HTTP/1.1 200 OK\n", header.success200StatusCode);

[Demonstration 3]

[Buggy Method]
public void upgradeAllSavedDatabases(Context context) {
    Log.d(TAG, "Upgrading all saved databases...");
    DatabaseController databaseController = DatabaseController.getInstance(context);
    ArrayList<File> files = databaseController.getFileList();
    Collections.sort(files, new Comparator<File>() {

        @Override
        public int compare(File f1, File f2) {
            if (f1.lastModified() == f2.lastModified()) {
                return 0;
            }
            return f1.lastModified() < f2.lastModified() ? -1 : 1;
        }
    });
    for (File file : files) {
        Log.d(TAG, "Upgrading file: " + file.getPath());
        Log.d(TAG, "last modified: " + file.lastModified());
        SQLiteDatabase database = databaseModel.getReadableDatabase(file);
        database.close();
    }
    Log.d(TAG, "Upgrade finished!");
}

[Buggy Hunk]
database.close();

[Patch]
databaseModel.close(file);