Freshly voided urine is best for urine testing of ketones.
There is also the 'breath test' to check for a sweet, sort of fruity smell. Always smelled like overripe bananas to me. You need a good sense of smell and a cooperative cat. Some people compare the smell of ketones to acetone, same ingredient as in nail polish remover.
Other ideas for
Testing and Catching Urine are in this document.
Cats that have muscle damage in their hind quarters are sometimes unable to express their bladders. They need manual help a couple of times a day to void their bladder so it does not burst. NOT to be done without experience. I never learned how, but there were other people at my local shelter who knew how, and they were willing to teach any potential adopters how to express a cat's bladder.
With male cats, it is sometimes possible to press very, very gently on their urethra to get some urine. Again, NOT something to be done without experience and a very cooperative cat.
p.s Sorry, was not around this AM. Emergency dental visit. Another one tomorrow. Might not be around much the next few days. I know personally what not wanting to eat because of dental/mouth pain feels like.
Thank you to everyone for pitching in this morning and throughout the day. Emergencies happen.