int size = getSize();
Object array = Array.newInstance(elementType, size);
MarshalFactory factory = env.getModuleContext().getMarshalFactory();
Marshal elementMarshal = factory.create(elementType);
int i = 0;
for (Map.Entry<Value, Value> entry : entrySet()) {
Array.set(array, i++, elementMarshal.marshal(env,
entry.getValue(),
elementType));
}
return array;