@Test
public void getObjectsFromArray() {

    List<String> values = Arrays.asList("32", "11", "43");
    Array array = getArray(Array.Type.INT, values);
    List<Object> retrieved = KiePMMLPredicateFactory.getObjectsFromArray(array);
    assertEquals(values.size(), retrieved.size());
    for (int i = 0; i < values.size(); i++) {
        Object obj = retrieved.get(i);
        assertTrue(obj instanceof Integer);
        Integer expected = Integer.valueOf(values.get(i));
        assertEquals(expected, obj);
    }
    values = Arrays.asList("just", "11", "fun");
    array = getArray(Array.Type.STRING, values);
    retrieved = KiePMMLPredicateFactory.getObjectsFromArray(array);
    assertEquals(values.size(), retrieved.size());
    for (int i = 0; i < values.size(); i++) {
        Object obj = retrieved.get(i);
        assertTrue(obj instanceof String);
        assertEquals(values.get(i), obj);
    }
    values = Arrays.asList("23.11", "11", "123.123");
    array = getArray(Array.Type.REAL, values);
    retrieved = KiePMMLPredicateFactory.getObjectsFromArray(array);
    assertEquals(values.size(), retrieved.size());
    for (int i = 0; i < values.size(); i++) {
        Object obj = retrieved.get(i);
        assertTrue(obj instanceof Double);
        Double expected = Double.valueOf(values.get(i));
        assertEquals(expected, obj);
    }
}