Add unit test cases for #4362