ExcelHandler { public Cell getCellData(int column, int row) throws Exception { column--; row--; if (this.selectedSheet.equals(null)) { throw new Exception("No sheet selected. You must select a sheet before trying to get data!"); } return this.selectedSheet.getCell(column, row); } ExcelHandler(File excelWorkbook); void selectSheet(String sheetName); String selectedSheetName(); HashMap<Integer, Cell> getColumn(int columnNumber); HashMap<Integer, Cell> getColumn(int columnNumber, boolean skipFirstRow); HashMap<Integer, Cell> getRow(int rowNumber); HashMap<Integer, Cell> getRow(int rowNumber, boolean skipFirstColumn); HashMap<String, Cell> mapTwoRows(int keyRow, int valueRow); HashMap<String, Cell> mapTwoRows(int keyRow, int valueRow, boolean skipFirstColumn); HashMap<String, Cell> mapTwoColumns(int keyColumn, int valueColumn); HashMap<String, Cell> mapTwoColumns(int keyColumn, int valueColumn, boolean skipFirstColumn); Cell getCellData(int column, int row);  }
@Test public void getCellData() throws Exception { ExcelHandler testExcelFile = new ExcelHandler(new File(excelFile.toURI())); testExcelFile.selectSheet("Data Sheet"); assertThat(testExcelFile.getCellData(1, 1).getContents(), is(equalTo("Test Data"))); assertThat(testExcelFile.getCellData(1, 2).getContents(), is(equalTo("1"))); }