BaseXlsImporter extends BaseImporter<Row, Cell> { public Workbook createReader(byte[] bytes, int cacheSize) { return StreamingReader.builder().rowCacheSize(cacheSize).open(new ByteArrayInputStream(bytes)); }  @Override int countRows(byte[] bytes, int sheetIndex); Workbook createReader(byte[] bytes, int cacheSize); Workbook createWorkbook(byte[] bytes); @Override Double getNumericValueWithDefault(Cell cell, ImportField field); @Override boolean isPercentageCorrectionSupported(); boolean isRowEmpty(Row row); T processRows(Sheet sheet, int firstRowIndex, int colIndex, Class<T> clazz);  }
@Test public void testCreateReader() throws IOException { byte[] bytes = readFile("importertest.xlsx"); Workbook wb = importer.createReader(bytes, 100); Iterator<Row> it = wb.getSheetAt(0).iterator(); assertTrue(it.hasNext()); PersonDTO dto = importer.processRow(0, it.next(), PersonDTO.class); assertNotNull(dto); assertEquals("Bas", dto.getName()); assertEquals(1, dto.getNumber().intValue()); assertEquals(2.4, dto.getFactor().doubleValue(), 0.001); assertEquals("abc", dto.getRandom()); dto = importer.processRow(1, it.next(), PersonDTO.class); assertNotNull(dto); assertEquals("Unknown", dto.getName()); assertEquals(2, dto.getNumber().intValue()); assertEquals(1.0, dto.getFactor().doubleValue(), 0.001); dto = importer.processRow(1, it.next(), PersonDTO.class); assertNotNull(dto); assertEquals("Endy", dto.getName()); assertEquals(-3, dto.getNumber().intValue()); }