use java code as test case