added JUnit tests
Merge pull request #668 from davherrmann/issue#257

added JUnit tests