code: public static List<String> readFileToLinesList( File file ) throws IOException {
          List<String> lines = new ArrayList<>();
          try (BufferedReader br = new BufferedReader(new FileReader(file))) {
              String line;
              while( (line = br.readLine()) != null ) {
                  lines.add(line);
              }
              return lines;
          }
      }
docs: Read text from a file to a list of lines.
  
  @param file the file to read.
  
  @return the list of lines.
  
  @throws IOException