added JUnit test cases.
Added JUnit test cases.