code: private static int findMinimumLeadingSpaces(String line, int count) {
          int length = line.length();
          int index = 0;
          while (index < length && index < count && Character.isWhitespace(line.charAt(index))) index++;
          return index;
      }
docs: TODO expose this for stream based scenarios?