Changed CardResource from groovy to java