This doesn't actually seem to make that much difference, but it is at least consistent with the main class body and with the Linux overrides.
Split the core requirement class into generic, Linux-specific, and macOS-specific parts. Additionally, the Linux version is now able to detect Java versions (the previous Linuxbrew implementation was only able to detect if Java was present at all.)