convert test case to java program