public static Value convertBoxedJavaType(Object boxed) {
        if (boxed == null) {
            return null;
        }

        final Class<?> clazz = boxed.getClass();

        if (clazz == String.class) {
            return new StringValue((String) boxed);
        } else if (clazz == Integer.class) {
            return new IntValue((Integer) boxed);
        } else if (clazz == Long.class) {
            return new LongValue((Long) boxed);
        } else if (clazz == Double.class) {
            return new DoubleValue((Double) boxed);
        } else if (clazz == Float.class) {
            return new FloatValue((Float) boxed);
        } else if (clazz == Boolean.class) {
            return new BooleanValue((Boolean) boxed);
        } else if (clazz == Byte.class) {
            return new ByteValue((Byte) boxed);
        } else if (clazz == Short.class) {
            return new ShortValue((Short) boxed);
        } else if (clazz == Character.class) {
            return new CharValue((Character) boxed);
        } else {
            throw new IllegalArgumentException("Object is no primitive Java type.");
        }
    }
@Test
    void testJavaToValueConversion() {
        assertThat(JavaToValueConverter.convertBoxedJavaType(null)).isNull();

        assertThat(JavaToValueConverter.convertBoxedJavaType("123Test"))
                .isEqualTo(new StringValue("123Test"));
        assertThat(JavaToValueConverter.convertBoxedJavaType((byte) 44))
                .isEqualTo(new ByteValue((byte) 44));
        assertThat(JavaToValueConverter.convertBoxedJavaType((short) 10000))
                .isEqualTo(new ShortValue((short) 10000));
        assertThat(JavaToValueConverter.convertBoxedJavaType(3567564))
                .isEqualTo(new IntValue(3567564));
        assertThat(JavaToValueConverter.convertBoxedJavaType(767692734L))
                .isEqualTo(new LongValue(767692734));
        assertThat(JavaToValueConverter.convertBoxedJavaType(17.5f))
                .isEqualTo(new FloatValue(17.5f));
        assertThat(JavaToValueConverter.convertBoxedJavaType(3.1415926))
                .isEqualTo(new DoubleValue(3.1415926));
        assertThat(JavaToValueConverter.convertBoxedJavaType(true))
                .isEqualTo(new BooleanValue(true));
        assertThat(JavaToValueConverter.convertBoxedJavaType('@')).isEqualTo(new CharValue('@'));

        assertThatThrownBy(() -> JavaToValueConverter.convertBoxedJavaType(new ArrayList<>()))
                .isInstanceOf(IllegalArgumentException.class);
    }