complete switch utils to groovy and test to spock