Adaptive Testing Scenario Library Generation for Connected and Automated Vehicles