private static int countLeadingCharacters(final String line) {
        int count = 0;
        for (char c : line.toCharArray()) {
            if (c == ' ') count++;
            else break;
        }
        return count / 3; // Assuming 3 spaces per level
    }
Parse the tree structure as taken from the Gherkin feature file.
gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/features/StepDefinition.java