Would this work instead: `System.getProperty("os.name", "").contains("Windows");`

`getProperty` can get a second argument to use as a default value.