public static int countLineFeeds(String text) {
        int count = 0;
        for (char c : text.toCharArray()) {
            if (c == '\n') {
                count++;
            }
        }
        return count;
    }
@Test
    void testCountLineFeeds() {
        assertEquals(2, StringUtils.countLineFeeds("foo\nbar\n"));
        assertEquals(0, StringUtils.countLineFeeds("foobar"));
    }