Java test codes