List<String> (String[] paths) { List<String> strings = new ArrayList<>(); for (String path : paths) { try (BufferedReader br = new BufferedReader(new FileReader(path))) { String s = br.readLine(); if (s != null) { strings.add(s); } } catch (IOException e) { e.printStackTrace(); } } return strings; }