### Question:
ExelTemplate { protected void generateDataNamedMap(XLSTransformer aTransformer) throws Exception { generated = new HashMap<>(); if (scriptData != null) { scriptData.keySet().stream().forEach((sid) -> { Object subject = scriptData.getMember(sid); generated.put(sid, JSDynaBean.wrap(subject, template.getTimezoneOffset())); }); } } ExelTemplate();  ExelTemplate(JSObject aScriptData, String aFormat, ReportTemplate aTemplate); JSObject getScriptData(); void setScriptData(JSObject aValue); byte[] getTemplate(); byte[] create();  }### Answer:
@Test public void testGenerateDataNamedMap() throws Exception { System.out.println("GenerateDataNamedMap jsObject"); JSObject data = (JSObject) Scripts.getSpace().exec("({name : 'test', count : 5, time : new Date(1402470671000), elems : [1, 'Hi', true, {text:'Hello!'}, new Date(1403461342000)]})"); ExelTemplate template = new ExelTemplate(data, "xlsx", new ReportTemplate(null, null, null, data)); XLSTransformer transformer = new XLSTransformer(); transformer.registerRowProcessor(new ExcelRowProcessor()); template.generateDataNamedMap(transformer); assertEquals(template.generated.size(), 4); assertEquals(template.generated.get("count"), 5); assertEquals(template.generated.get("name"), "test"); double expectedNamedTimestamp = 1402470671000d / 86400000d + 25569; Object doubledDate = template.generated.get("time"); assertTrue(doubledDate instanceof Double); double generatedNamedTimestamp = (Double) doubledDate; assertTrue(Math.abs(expectedNamedTimestamp - generatedNamedTimestamp) < 1e-10d); JSDynaList list = (JSDynaList) template.generated.get("elems"); assertEquals(list.get(0), 1); assertEquals(list.get(1), "Hi"); assertEquals(list.get(2), Boolean.TRUE); assertEquals(((JSDynaBean) list.get(3)).get("text"), "Hello!"); double expectedIndexedTimestamp = 1403461342000d / 86400000d + 25569; double generatedIndexedTimestamp = (Double) list.get(4); assertTrue(Math.abs(expectedIndexedTimestamp - generatedIndexedTimestamp) < 1e-10); }