### Question:
JVM { public boolean isAtLeastVersion(int minimumMajor, int minimumMinor) throws VersionException { final String version = System.getProperty("java.version"); final StringTokenizer versionTokenizer = new StringTokenizer(version, "."); try { final int major = Integer.parseInt(versionTokenizer.nextToken()); final int minor = Integer.parseInt(versionTokenizer.nextToken()); return major >= minimumMajor && minor >= minimumMinor; } catch (NoSuchElementException e) { throw new VersionException("Could not parse JVM version " + version); } catch (NumberFormatException e) { throw new VersionException("Could not parse JVM version " + version); } } private  JVM(); static JVM getInstance(); boolean haveRequisites(Logger logger); boolean isAtLeastVersion(int minimumMajor, int minimumMinor); String toString();  }### Answer:
@Test public void testIsAtLeastVersion() throws Exception { final JVM jvm = JVM.getInstance(); assertTrue(jvm.isAtLeastVersion(1, 1)); assertTrue(jvm.isAtLeastVersion(1, 2)); assertTrue(jvm.isAtLeastVersion(1, 3)); assertFalse(jvm.isAtLeastVersion(3, 0)); assertFalse(jvm.isAtLeastVersion(1, 9)); final String[] badVersions = { "not parseable", "123123", "", }; final String oldVersion = System.getProperty("java.version"); try { for (int i = 0; i < badVersions.length; ++i) { System.setProperty("java.version", badVersions[i]); try { jvm.isAtLeastVersion(1, 3); fail("Expected JVM.VersionException"); } catch (JVM.VersionException e) { } } } finally { System.setProperty("java.version", oldVersion); } }