@Test
public void testReplaceWithSysProps() {

    Assert.assertEquals("some literal", StringPropertyReplacer.replaceProperties("some literal"));
    Assert.assertEquals("${my.sysprop}", StringPropertyReplacer.replaceProperties("${my.sysprop}"));
    Assert.assertEquals("abc", StringPropertyReplacer.replaceProperties("${my.sysprop:abc}"));
    System.setProperty("my.sysprop", "xyz");
    Assert.assertEquals("my.sysprop", StringPropertyReplacer.replaceProperties("my.sysprop"));
    Assert.assertEquals("xyz", StringPropertyReplacer.replaceProperties("${my.sysprop}"));
    Assert.assertEquals("xyz", StringPropertyReplacer.replaceProperties("${my.sysprop:abc}"));
    Assert.assertEquals("xyz", StringPropertyReplacer.replaceProperties("${my.sysprop,does-not-exist:abc}"));
    Assert.assertEquals("xyz", StringPropertyReplacer.replaceProperties("${my.sysprop,does-not-exist}"));
    Assert.assertEquals("xyz", StringPropertyReplacer.replaceProperties("${does-not-exist,my.sysprop:abc}"));
    Assert.assertEquals("xyz", StringPropertyReplacer.replaceProperties("${does-not-exist,my.sysprop}"));
    System.clearProperty("my.sysprop");
    Assert.assertEquals("abc", StringPropertyReplacer.replaceProperties("${my.sysprop:abc}"));
    Assert.assertEquals("abc", StringPropertyReplacer.replaceProperties("${unknown1,unknown2,unknown3:abc}"));
}