Java API: Prepare sufficiently initial capacity on JS object map for callbacks