@NonNull
    String readOperatingSystemName(File dataFile, @NonNull String patternStr) {
        if (dataFile == null || !dataFile.exists()) {
            return "";
        }
        Pattern pattern = Pattern.compile("^PRETTY_NAME=[\"](" + patternStr + ")[\"]");
        String name = "";
        try {
            List<String> lines = dataFile.equals(lastDataFile) ? lastLines : Files.readAllLines(dataFile.toPath());
            for (String line : lines) {
                Matcher matcher = pattern.matcher(line);
                if (matcher.matches()) {
                    name = matcher.group(1);
                }
            }
            if (!dataFile.equals(lastDataFile)) {
                lastDataFile = dataFile;
                lastLines = new ArrayList<>(lines);
            }
        } catch (IOException ioe) {
            LOGGER.log(Level.SEVERE, "File read exception", ioe);
        }
        return name;
    }
@Test
    public void testReadOperatingSystemNameMissingFile() {
        assertThat(monitor.readOperatingSystemName(new File("/this/file/does/not/exist"), ".*"), is(""));
    }