In the above script, since I'm more comfortable with Java, I used ArrayList and LinkedHashMap. Is it the correct way to do this? If yes, please do review the overall correctness and efficiency of the code. If not, is there a way to do this only using the scripting language and not using Java's collections framework. My understanding is that, for large datasets, it is better to avoid collections framework (ideally, avoiding the script altogether is a better option). Any other approach is also welcome.

PS: I did not find a tag for snaplogic so I'm tagging it under JavaScript and Java. This is because, I've set the scripting language to JavaScript and I'm using Java's collections framework in it.

\$\begingroup\$Ideally, this post should be tagged as SnapLogic but since it is not available I'm using the tags to indicate the appropriate language elements.\$\endgroup\$
– Bilesh GangulyJan 20 '17 at 11:23