code: public static List<String> readAllLines(String path) throws FileNotFoundException, IOException {
          List<String> result = new ArrayList<String>();
          try (FileInputStream fis = new FileInputStream(path)) {
              try (InputStreamReader isr = new InputStreamReader(fis)) {
                  try (BufferedReader br = new BufferedReader(isr)) {
                      String line;
                      while ((line = br.readLine()) != null) {
                          result.add(line);
                      }
                  }
              }
          }
          return result;
      }
docs: Reads all lines in the file specified by {@code path}. Obviously be careful not
  to call this on potentially large files.
  
  @param path Path to read.
  @return List of lines from the file.
  @throws FileNotFoundException File cannot be found.
  @throws IOException Error reading the file.