Added Junit test cases for unit testing.