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