Fix SamplesToolingApiIntegrationTest by using more Groovy-ish code.