final MetaClass arrayType = toMap.asArrayOf(dim);
MetaClass outerType = toMap.getOuterComponentType();
if (!outerType.isArray() && outerType.isPrimitive()) {
outerType = outerType.asBoxed();
}
Statement demarshallerStatement =
Stmt.loadVariable(getVarName(outerType)).invoke("demarshall", loadVariable("a0")
.invoke("get", loadVariable("i")), Stmt.loadVariable("a1"));