### Question:
ConfigurationUtils { public static String tryGetGlobalProperty(String key, String defaultValue) { try { String value = System.getenv(formatEnvironmentVariable(key)); if (value == null) { value = tryGetProperty(key, defaultValue); } return value; } catch (SecurityException e) { logger.error("Could not get value of global property {} due to SecurityManager. Using default value.", key, e); return defaultValue; } } private  ConfigurationUtils(); static String formatEnvironmentVariable(String key); static String tryGetGlobalProperty(String key, String defaultValue); static String tryGetGlobalProperty(String key); static Integer tryGetGlobalIntegerProperty(String key, Integer defaultValue); static Integer tryGetGlobalIntegerProperty(String key);  }### Answer:
@Test public void testExistingTryGetProperty(){ System.setProperty(TEST_PROPERTY_NAME, "MyNiceValue"); assertThat(ConfigurationUtils.tryGetGlobalProperty(TEST_PROPERTY_NAME)).isEqualTo("MyNiceValue"); }
@Test public void testNonExistingTryGetProperty(){ assertThat(ConfigurationUtils.tryGetGlobalProperty(TEST_PROPERTY_NAME)).isNull(); }
@Test public void testEnvVarLookup() { assertThat(ConfigurationUtils.tryGetGlobalProperty("test.env.var")) .isEqualTo("Ok"); }
@Test public void testEnvVarUppercaseLookup() { assertThat(ConfigurationUtils.tryGetGlobalProperty("TEST_ENV_VAR")) .isEqualTo("Ok"); }