public String asString(Map<String, ValueReference> parameters) {
        switch (valueType()) {
            case STRING:
                return String.class.cast(value());
            case PARAMETER:
                return asType(parameters, String.class);
            default:
                throw new IllegalStateException("Expected value reference of type STRING but got " + valueType());
        }
    }
@Test
    public void asString() {
        assertThat(ValueReference.of("Test").asString(Collections.emptyMap())).isEqualTo("Test");
        assertThatThrownBy(() -> ValueReference.of(false).asString(Collections.emptyMap()))
                .isInstanceOf(IllegalStateException.class)
                .hasMessage("Expected value reference of type STRING but got BOOLEAN");
    }