ConfigUtils { public static String getSystemProperty(String key) { String value = System.getenv(key); if (value == null || value.length() == 0) { value = System.getProperty(key); } return value; } private  ConfigUtils(); static boolean isNotEmpty(String value); static boolean isEmpty(String value); static boolean isDefault(String value); static List<String> mergeValues(Class<?> type, String cfg, List<String> def); static String replaceProperty(String expression, Map<String, String> params); static Properties getProperties(); static void setProperties(Properties properties); static void addProperties(Properties properties); static String getProperty(String key); @SuppressWarnings({"unchecked", "rawtypes"}) static String getProperty(String key, String defaultValue); static String getSystemProperty(String key); static Properties loadProperties(String fileName); static Properties loadProperties(String fileName, boolean allowMultiFile); static Properties loadProperties(String fileName, boolean allowMultiFile, boolean optional); static int getPid(); @SuppressWarnings("deprecation") static int getServerShutdownTimeout();  }
@Test public void testGetSystemProperty() throws Exception { try { System.setProperty("dubbo", "system-only"); assertThat(ConfigUtils.getSystemProperty("dubbo"), equalTo("system-only")); } finally { System.clearProperty("dubbo"); } }