### Question:
Excel { public Object[][] readBlock(final String range, final Class<?>... columnTypes) { if (columnTypes == null || columnTypes.length == 0) { throw new ExcelException("columnTypes cannot be null / empty"); } final CellRangeAddress cra = CellRangeAddress.valueOf(range); final AreaReference ar = new AreaReference(range, null); final Sheet sheet = workbook.getSheet(ar.getFirstCell().getSheetName()); final int firstColumn = cra.getFirstColumn(); final int firstRow = cra.getFirstRow(); final int lastRow = cra.getLastRow(); final int height = lastRow - firstRow + 1; final int width = cra.getLastColumn() - firstColumn + 1; List<Object> result; if (height == 1) { result = new LinkedList<>(); } else { result = new ArrayList<>(height); } for (int rowNum = 0; moreDataToRead(sheet, firstColumn, firstRow, lastRow, rowNum); rowNum++) { final Row row = sheet.getRow(firstRow + rowNum); final Object[] resultRow = new Object[width]; result.add(resultRow); for (int colNum = 0; colNum < width; colNum++) { Class<?> colType; if (colNum < columnTypes.length - 1) { colType = columnTypes[colNum]; } else { colType = columnTypes[columnTypes.length - 1]; } final Cell cell = row.getCell(firstColumn + colNum); resultRow[colNum] = readCell(cell, colType); } } return result.toArray(new Object[][] {}); } Excel(final InputStream in); E readValueAt(final String cellAddress, final Class<E> type); List<E> readColumn(final String rangeOrStartAddress, final Class<E> type); String namedRangeToRangeAddress(final String namedRange); Cell cellAt(final String cellAddr); Object[][] readBlock(final String range, final Class<?>... columnTypes); Workbook getWorkbook();  }### Answer:
@Test public void shouldReadTwoLinesAndStop() { Object[][] result = xlsx.readBlock("'Test Sheet'!C3:F4", String.class, Integer.class); assertEquals("Number of rows read should be 2", 2, result.length); assertEquals("Number of columns read should be 4", 4, result[0].length); assertEquals("Number of columns read should be 4", 4, result[1].length); }
@Test public void shouldReadWholeBlockGivenTopLine() { Object[][] result = xlsx.readBlock("'Test Sheet'!C3:F3", String.class, Integer.class); assertEquals("Number of rows read should be 9", 9, result.length); assertEquals("Number of columns read should be 4", 4, result[0].length); assertEquals("Number of columns read should be 4", 4, result[8].length); }