chang the  groovy tool from groovy script to java