added code to generate test cases based on nesting structures