GROOVY-5783: Inconsistency when generating sets