private static void createTextFile(String filename, List<Result> resultList) {
        BufferedWriter writer = null;

        try {
            File file = new File(filename);
            if (!file.exists()) {
                file.createNewFile();
            }
            writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), "UTF-8"));
            for (int i = 0; i < resultList.size(); i++) {
                Result result = (Result) resultList.get(i);
                writer.write(result.getId() + "\t" + result.getResult());
                writer.newLine();
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                if (writer != null) {
                    writer.close();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }