add Junit Tests
minor coding style improvement