public static void readOneLineFromFile() throws RuntimeException { // TODO: read 1 line of the file LinkedList<String> stringsOfFile = FileManager.readFromFile(); // Each line contains, type, question, answer if (stringsOfFile == null) { System.out.println("Line read from file is null"); throw new RuntimeException("File doesn't exist"); } System.out.println("This list has " + stringsOfFile.size() + " strings"); for (int i = 0; i < stringsOfFile.size() - 1; ) { Wrapper current = new Wrapper(); // Put the linked list to the wrapper class consecutively current.questionType = stringsOfFile.get(i++); current.question = stringsOfFile.get(i++); current.answer = stringsOfFile.get(i++); // Add this question to the question collection questionCollection.add(current); } // Load the first question currentQuestion = questionCollection.get(currentQuestionIndex); // Update the question count questionCount = questionCollection.size(); // Parse the line System.out.println("Finished parsing file"); }