ConfigUtils { public static String getProperty(String key) { return getProperty(key, null); } 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();  }
@Test public void testGetProperty() throws Exception { assertThat(ConfigUtils.getProperty("dubbo"), equalTo("properties")); }
@Test public void testGetPropertyDefaultValue() throws Exception { assertThat(ConfigUtils.getProperty("not-exist", "default"), equalTo("default")); }
@Test public void testGetPropertyFromSystem() throws Exception { try { System.setProperty("dubbo", "system"); assertThat(ConfigUtils.getProperty("dubbo"), equalTo("system")); } finally { System.clearProperty("dubbo"); } }