added junit and a few test cases