public static String substVars(String val, PropertyContainer pc1) throws ScanException {
        return substVars(val, pc1, null);
    }
@Test
    public void detectCircularReferencesInDefault() throws ScanException {
        context.putProperty("A", "${B:-${A}}");
     

        Exception e = assertThrows(IllegalArgumentException.class, () -> {
            OptionHelper.substVars("${A}", context);
        });

        String expectedMessage = CIRCULAR_VARIABLE_REFERENCE_DETECTED+"${A} --> ${B} --> ${A}]";
        assertEquals(expectedMessage, e.getMessage());
    }