private static String getActualValue(String configVal) {
        if (configVal != null && configVal.matches("^.*\\$\\{[\\w.]+(:.*)?}.*$")) {
            final int startIndex = configVal.indexOf("${") + 2;
            final int endIndex = configVal.indexOf('}', startIndex);
            final String envKey = configVal.substring(startIndex, endIndex);
            final int separatorIndex = envKey.indexOf(':');
            final String key = separatorIndex >= 0 ? envKey.substring(0, separatorIndex) : envKey;
            final String defaultValue = separatorIndex >= 0 ? envKey.substring(separatorIndex + 1) : "";

            // The priority is environment variables > system variables
            if (!StringUtils.isBlank(System.getenv(key))) {
                return System.getenv(key);
            }
            if (!StringUtils.isBlank(System.getProperty(key))) {
                return System.getProperty(key);
            }
            return defaultValue;
        }
        return configVal;
    }
@Test
    public void testGetActualValue()
            throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, NoSuchFieldException {
        Method method = BootArgsBuilder.class.getDeclaredMethod("getActualValue", String.class);
        method.setAccessible(true);
        assertEquals("demo", method.invoke(BootArgsBuilder.class, "${serviceAName:A}"));
        assertEquals("1.0", method.invoke(BootArgsBuilder.class, "${serviceAVersion:2.0}"));
        assertEquals("B", method.invoke(BootArgsBuilder.class, "${serviceBName:B}"));
        assertEquals("2.0", method.invoke(BootArgsBuilder.class, "${serviceBVersion:2.0}"));
    }