@Test
public void testSetSysProp() {

    Assert.assertEquals("false", StringPropertyReplacer.replaceProperties("${<set>my.sysprop}"));
    Assert.assertEquals("false", StringPropertyReplacer.replaceProperties("${doesntexist,<set>my.sysprop}"));
    System.setProperty("my.sysprop", "xyz");
    Assert.assertEquals("true", StringPropertyReplacer.replaceProperties("${<set>my.sysprop}"));
    Assert.assertEquals("true", StringPropertyReplacer.replaceProperties("${doesntexist,<set>my.sysprop}"));
    System.clearProperty("my.sysprop");
    try {
        StringPropertyReplacer.replaceProperties("${<set>my.sysprop,foo}");
        Assert.fail("Should not be able to specify composite key when using set");
    } catch (IllegalArgumentException expected) {
    }
    try {
        StringPropertyReplacer.replaceProperties("${<set>my.sysprop:blah}");
        Assert.fail("Should not be able to specify default value when using set");
    } catch (IllegalArgumentException expected) {
    }
}