Not suprisingly most programming languages handle this check the same way. You have to check for null first to avoid a NullPointerException.
Java has the worst syntax for declaring a constant that I’ve ever seen. Here it is so I can remember it. At least in the Java programming culture we have the sense to declare the names in ALL_CAPS.
Besides Multiplicity being a great film, you can launch multiple instances of any application in macOS. Open the Terminal app and run the following (replacing Safari.app with any app of your choosing). I do this often for the Eclipse IDE or the Spring Tool Suite.
It seems I do this a few times a month and I always have to look it up. Leaving myself a note for later.
puts 'Hello World'