@Test
public void invalidExpression() {

    String[] testData = {
            "$unknown",
            "$hostunknown",
            "${prop: with space}"
    };
    for (String t : testData) {
        try {
            NetworkUtil.replaceExpression(t);
            fail(t+ " has been parsed");
        } catch (IllegalArgumentException exp) {
            // Ok.
        }
    }
}