void () { //<property name="a" value="aValue"/> //<property name="b" value="${a}bValue"/> //<property name="c" value="${d}cValue"/> //<property name="d" value="dValue"/> PropertiesProvider[] providers = new PropertiesProvider[] { new PropertiesProviderImpl("a", "aValue"), new PropertiesProviderImpl("b", "${a}bValue"), new PropertiesProviderImpl("c", "${d}cValue"), new PropertiesProviderImpl("d", "dValue"), }; assertEquals("abc", expand(providers, "abc")); assertEquals("aValue", expand(providers, "${a}")); assertEquals("aValuebValue", expand(providers, "${b}")); assertEquals("${d}cValue", expand(providers, "${c}")); assertEquals("dValue", expand(providers, "${d}")); assertEquals("${d}cValuedValue", expand(providers, "${c}${d}")); PropertiesProvider[] providers2 = new PropertiesProvider[] { new PropertiesProviderImpl("loop.me1", "prefix-${loop.me2}"), new PropertiesProviderImpl("loop.me2", "prefix-${loop.me1}"), new PropertiesProviderImpl("loop.me3", "prefix-${loop.me3}"), new PropertiesProviderImpl("aaa", "aaa_val_${bbb}"), new PropertiesProviderImpl("bbb", "bbb_val"), new PropertiesProviderImpl("ccc", "${aaa}_${bbb}"), }; assertEquals("prefix-${loop.me2}", expand(providers2, "${loop.me1}")); assertEquals("prefix-prefix-${loop.me2}", expand(providers2, "${loop.me2}")); assertEquals("prefix-${loop.me3}", expand(providers2, "${loop.me3}")); assertEquals("aaa_val_${bbb}_bbb_val", expand(providers2, "${ccc}")); }