### Question:
JVM { public boolean haveRequisites(Logger logger) throws VersionException { final String name = "The Grinder " + GrinderBuild.getVersionString(); if (!isAtLeastVersion(1, 6)) { logger.error("Fatal Error - incompatible version of Java ({})%n" + "{} requires at least Java SE 6.", this, name); return false; } return true; } private  JVM(); static JVM getInstance(); boolean haveRequisites(Logger logger); boolean isAtLeastVersion(int minimumMajor, int minimumMinor); String toString();  }### Answer:
@Test public void testHaveRequisites() throws Exception { final Logger logger = mock(Logger.class); final JVM jvm = JVM.getInstance(); assertTrue(jvm.haveRequisites(logger)); verifyNoMoreInteractions(logger); final String oldVersion = System.getProperty("java.version"); try { System.setProperty("java.version", "1.2"); assertFalse(jvm.haveRequisites(logger)); verify(logger).error(contains("incompatible version"), same(jvm), isA(String.class)); } finally { System.setProperty("java.version", oldVersion); } }