public static String substVars(String val, PropertyContainer pc1) throws ScanException {
        return substVars(val, pc1, null);
    }
@Test
    @Timeout(value = 1, unit = SECONDS)
    public void stubstVarsShouldNotGoIntoInfiniteLoop() throws ScanException {
        context.putProperty("v1", "if");
        context.putProperty("v2", "${v3}");
        context.putProperty("v3", "${v4}");
        context.putProperty("v4", "${v2}c");

        Exception e = assertThrows(Exception.class, () -> {
            OptionHelper.substVars(text, context);
        });
        String expectedMessage =  CIRCULAR_VARIABLE_REFERENCE_DETECTED+"${v2} --> ${v3} --> ${v4} --> ${v2}]";
        assertEquals(expectedMessage, e.getMessage());
    }