Change some test methods and java codes.