### Question:
ModuleUtil { public static boolean isOpenmrsVersionInVersions(String ...versions) { if (versions == null || versions.length == 0) { return false; } boolean result = false; for (String version : versions) { if (matchRequiredVersions(OpenmrsConstants.OPENMRS_VERSION_SHORT, version)) { result = true; break; } } return result; } private  ModuleUtil(); static void startup(Properties props); static void shutdown(); static File insertModuleFile(InputStream inputStream, String filename); static boolean isOpenmrsVersionInVersions(String ...versions); static boolean matchRequiredVersions(String version, String versionRange); static void checkRequiredVersion(String version, String versionRange); static int compareVersion(String version, String value); static boolean isVersionWithQualifier(String version); static File getModuleRepository(); static URL file2url(final File file); static void expandJar(File fileToExpand, File tmpModuleDir, String name, boolean keepFullPath); static InputStream getURLStream(URL url); static String getURL(URL url); static Boolean checkForModuleUpdates(); static Boolean allowAdmin(); static AbstractRefreshableApplicationContext refreshApplicationContext(AbstractRefreshableApplicationContext ctx); static AbstractRefreshableApplicationContext refreshApplicationContext(AbstractRefreshableApplicationContext ctx,
	        boolean isOpenmrsStartup, Module startedModule); static boolean ignoreCoreModules(); static List<String> getMandatoryModules(); static Module getModuleForPath(String path); static String getPathForResource(Module module, String path); static Collection<String> getPackagesFromFile(File file); static InputStream getResourceFromApi(JarFile jarFile, String moduleId, String version, String resource); static File getDevelopmentDirectory(String moduleId);  }### Answer:
@Test public void isOpenmrsVersionInVersions_shouldReturnFalseWhenVersionsIsNull() { Assert.assertFalse(ModuleUtil.isOpenmrsVersionInVersions((String[]) null)); }
@Test public void isOpenmrsVersionInVersions_shouldReturnFalseWhenVersionsIsEmpty() { Assert.assertFalse(ModuleUtil.isOpenmrsVersionInVersions()); }
@Test public void isOpenmrsVersionInVersions_shouldReturnTrueIfCurrentOpenmrsVersionMatchesOneElementInVersions() throws Exception { Field versionField = OpenmrsConstants.class.getDeclaredField("OPENMRS_VERSION_SHORT"); Field modifiersField = Field.class.getDeclaredField("modifiers"); modifiersField.setAccessible(true); modifiersField.setInt(versionField, versionField.getModifiers() & ~Modifier.FINAL); final String currentVersion = "1.9.8"; versionField.set(null, currentVersion); Assert.assertTrue(ModuleUtil.isOpenmrsVersionInVersions( currentVersion, "1.10.*")); }
@Test public void isOpenmrsVersionInVersions_shouldReturnFalseIfCurrentOpenmrsVersionDoesNotMatchAnyElementInVersions() throws Exception { Field versionField = OpenmrsConstants.class.getDeclaredField("OPENMRS_VERSION_SHORT"); Field modifiersField = Field.class.getDeclaredField("modifiers"); modifiersField.setAccessible(true); modifiersField.setInt(versionField, versionField.getModifiers() & ~Modifier.FINAL); versionField.set(null, "1.9.8"); Assert.assertFalse(ModuleUtil.isOpenmrsVersionInVersions("1.11.*", "2.1.0")); }