convert Test case to java program