### Question:
ModuleUtil { public static List<String> getMandatoryModules() { List<String> mandatoryModuleIds = new ArrayList<>(); try { List<GlobalProperty> props = Context.getAdministrationService().getGlobalPropertiesBySuffix(".mandatory"); for (GlobalProperty prop : props) { if ("true".equalsIgnoreCase(prop.getPropertyValue())) { mandatoryModuleIds.add(prop.getProperty().replace(".mandatory", "")); } } } catch (Exception e) { log.warn("Unable to get the mandatory module list", e); } return mandatoryModuleIds; } 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 getMandatoryModules_shouldReturnMandatoryModuleIds() { GlobalProperty gp1 = new GlobalProperty("firstmodule.mandatory", "true"); GlobalProperty gp2 = new GlobalProperty("secondmodule.mandatory", "false"); Context.getAdministrationService().saveGlobalProperty(gp1); Context.getAdministrationService().saveGlobalProperty(gp2); assertThat(ModuleUtil.getMandatoryModules(), contains("firstmodule")); }