Added JUnit tests.