public static String substVars(String val, PropertyContainer pc1) throws ScanException {
        return substVars(val, pc1, null);
    }
@Test
    public void openBraceAsLastCharacter() throws JoranException, ScanException {
        Exception e = assertThrows(IllegalArgumentException.class, () -> {
            OptionHelper.substVars("a{a{", context);
        });
        String expectedMessage = "All tokens consumed but was expecting \"}\"";
        assertEquals(expectedMessage, e.getMessage());
    }