Complete CodeGenUtils with tests