public static List<Object> getObjectsFromArray(Array source) {
        Array.Type type = source.getType();
        List<Object> toReturn = new ArrayList<>();
        String stringValue = (String) source.getValue();
        String[] valuesArray = stringValue.split(" ");
        for (String s : valuesArray) {
            switch (type) {
                case INT:
                    toReturn.add(Integer.valueOf(s));
                    break;
                case STRING:
                    toReturn.add(s);
                    break;
                case REAL:
                    toReturn.add(Double.valueOf(s));
                    break;
                default:
                    throw new KiePMMLException("Unknown Array " + type);
            }
        }
        return toReturn;
    }
@Test
    void getObjectsFromArray() {
        List<String> values = Arrays.asList("32", "11", "43");
        Array array = getArray(Array.Type.INT, values);
        List<Object> retrieved = org.kie.pmml.compiler.api.utils.ModelUtils.getObjectsFromArray(array);
        assertThat(retrieved).hasSameSizeAs(values);
        for (int i = 0; i < values.size(); i++) {
            Object obj = retrieved.get(i);
            assertThat(obj).isInstanceOf(Integer.class);
            Integer expected = Integer.valueOf(values.get(i));
            assertThat(obj).isEqualTo(expected);
        }
        values = Arrays.asList("just", "11", "fun");
        array = getArray(Array.Type.STRING, values);
        retrieved = org.kie.pmml.compiler.api.utils.ModelUtils.getObjectsFromArray(array);
        assertThat(retrieved).hasSameSizeAs(values);
        for (int i = 0; i < values.size(); i++) {
            Object obj = retrieved.get(i);
            assertThat(obj).isInstanceOf(String.class);
            assertThat(obj).isEqualTo(values.get(i));
        }
        values = Arrays.asList("23.11", "11", "123.123");
        array = getArray(Array.Type.REAL, values);
        retrieved = org.kie.pmml.compiler.api.utils.ModelUtils.getObjectsFromArray(array);
        assertThat(retrieved).hasSameSizeAs(values);
        for (int i = 0; i < values.size(); i++) {
            Object obj = retrieved.get(i);
            assertThat(obj).isInstanceOf(Double.class);
            Double expected = Double.valueOf(values.get(i));
            assertThat(obj).isEqualTo(expected);
        }
    }