The best/most accurate way to test for things like this is in a white-box security assessment approach, by checking the version of Java installed on the system. So on a redhat system something like rpm -qa would provide the version installed, then check the changelogs for the package which should list what CVE's have been addressed.
To automate that, something like Nessus can be used with credentials to provide info. on what outdated packages are installed on a system.
If you're trying to do this "black box" they you'd need to dig into the exact details of the vuln (which may well be tricky if there has been no disclosure of the technical details, which is the case with many issues) and then see if it's remotely exploitable.