added JUnit tests.