private static int getBlankLines(@NotNull String text) {
    int result = 0;
    int currentIndex = -1;
    while ((currentIndex = text.indexOf('\n', currentIndex + 1)) >= 0) result++;
    return result;
  }
private static int getBlankLines(@NotNull String text)