public static String substVars(String val, PropertyContainer pc1) throws ScanException {
        return substVars(val, pc1, null);
    }
@Test
    @Timeout(value = 1, unit = SECONDS)
    public void detectCircularReferences3() throws ScanException {
        context.putProperty("A", "${B}");
        context.putProperty("B", "${C}");
        context.putProperty("C", "${A}");

        Exception e = assertThrows(IllegalArgumentException.class, () -> {
            OptionHelper.substVars("${B} ", context);
        });
        String expectedMessage = CIRCULAR_VARIABLE_REFERENCE_DETECTED + "${B} --> ${C} --> ${A} --> ${B}]";
        assertEquals(expectedMessage, e.getMessage());

    }