rewrite test with Junit