This test fixture class does not check for the null array that will be returned when the assumed directories do not actually exist.
Happens to me under windows since C:/Program Files/Java doesn’t exist - which could also actually be C:/Program Files (x86)/Java for a 32-bit JVM under a 64-bit windows OS, but it doesn’t check for that right now.
org.gradle.integtest.environment.BuildEnvironmentIntegrationTest will evidence the problem with the assumed directories missing.
Simply missing the isDirectory() test of the other two flavors of OSes (macosx and unix).
Submitted a pull request on my merscwog:build_env_test branch: