added test cases and generator code