Added test cases and awaitTermination