public Float asFloat(Map<String, ValueReference> parameters) {
        switch (valueType()) {
            case FLOAT:
                if (value() instanceof Number) {
                    return ((Number) value()).floatValue();
                }
                throw new IllegalStateException("Expected value reference of type FLOAT but got " + value().getClass());
            case PARAMETER:
                return asType(parameters, Float.class);
            default:
                throw new IllegalStateException("Expected value reference of type FLOAT but got " + valueType());
        }
    }
@Test
    public void asFloat() {
        assertThat(ValueReference.of(1.0f).asFloat(Collections.emptyMap())).isEqualTo(1.0f);
        assertThatThrownBy(() -> ValueReference.of("Test").asFloat(Collections.emptyMap()))
                .isInstanceOf(IllegalStateException.class)
                .hasMessage("Expected value reference of type FLOAT but got STRING");
    }