ConfigUtils { public static List<String> getPropertyNamesWithPrefix(String prefix) { if (StringUtils.isBlank(prefix)) { throw new IllegalArgumentException("不允许输入空值"); } return PROPERTIES.stringPropertyNames().stream().filter(pn -> pn.startsWith(prefix)).collect(Collectors.toList()); } private  ConfigUtils(); static boolean isNotEmpty(String value); static boolean isEmpty(String value); static boolean isDefault(String value); static Properties getProperties(); static void setProperties(Properties properties); static void addProperties(Properties properties); static int getInt(String key); static int getInt(String key, int defaultValue); static String getProperty(String key); @SuppressWarnings({"unchecked", "rawtypes"}) static String getProperty(String key, String defaultValue); static String replaceProperty(String expression, Map<String, String> params); 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(); static List<String> getPropertyNamesWithPrefix(String prefix); static String getProtocol(); static String getDefaultGroup(); static String getDefaultVersion(); static String getDefaultServer();  }
@Test public void getPropertyNamesWithPrefix() { ConfigUtils.getProperties(); String prefix = "rpc.registry.instance."; List<String> registryPropNames= ConfigUtils.getPropertyNamesWithPrefix(prefix); }