class Test shared def main .tryParse .tryGetValue def tryParse i = 0 r = int.tryParse('1', out i) assert r and i == 1 r = int.tryParse('aoeu', out i) assert not r and i == 0 r = int.tryParse('1', out i) assert r def tryGetValue d = {'one': 1} i = 0 r = d.tryGetValue('one', out i) r = d.tryGetValue('two', out i) assert not r and i == 0 r = d.tryGetValue('one', out i) assert r