public static List<String> readLines(Path path, boolean ignoreComments) throws IOException {
        File file = path.toFile();
        if (!file.isFile()) {
            return new ArrayList<>();
        }

        List<String> lines = new ArrayList<>();

        try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
            String line;
            while ((line = reader.readLine()) != null) {
                if (!(ignoreComments && line.startsWith("#")) && !lines.contains(line)) {
                    lines.add(line);
                }
            }
        }

        return lines;
    }
@Test
    public void readLinesIgnoreCommentTest() throws IOException {
        File file = createSampleFile("test");

        // ignoreComments = true
        List<String> ignoreCommentsLines = FileUtils.readLines(file.toPath(), true);
        assertEquals("1 content", ignoreCommentsLines.get(0));
        assertEquals(2, ignoreCommentsLines.size());

        // ignoreComments = false
        List<String> lines = FileUtils.readLines(file.toPath(), false);
        assertEquals("# 1 comment", lines.get(0));
        assertEquals(4, lines.size());
        file.deleteOnExit();
    }