rewrite junit testcase