code: public static int getLineCount(final String text) {
      final Matcher matcher = LINE_FINDER.matcher(text);
      int i = 0;
  
      while (matcher.find()) {
        i++;
      }
  
      return i;
    }
docs: Gets a zero-based line count of text.
  
  @param text a string in which to count lines
  @return a number of {@code \n} new lines in the text