A Groovy discriminated union implementation