private static List<String> grepFile(String errorMessage, Path file, Pattern pattern) {
    List<String> result = new ArrayList<>();
    try (BufferedReader reader = Files.newBufferedReader(file, StandardCharsets.UTF_8)) {
      String line;

      while ((line = reader.readLine()) != null) {
        if (pattern.matcher(line).matches()) {
          result.add(line);
        }
      }
      return result;
    }
    catch (IOException e) {
      LOG.info(errorMessage, e);
      return Collections.emptyList();
    }
  }
private static List<String> grepFile(String errorMessage, Path file, Pattern pattern)