make groovy react like java