Properties custom = new Properties();
custom.setProperty("foo", "bar");
custom.setProperty("boo", "foo");
final String original = "I have a ${foo} and a ${baz:wiz}, but not a $${foo}, a $${ba${boo}n} but not a $${ba$${boo}n}, a $${baz:wiz}, or a $${baz:$${oo}${ka}}.";
final String expected = "I have a bar and a wiz, but not a ${foo}, a ${bafoon} but not a ${ba${boo}n}, a ${baz:wiz}, or a ${baz:${oo}${ka}}.";
final String actual = Strings.replaceProperties(original, new PropertiesPropertyResolver(custom));
Assert.assertEquals(expected, actual);
}