BaseXlsImporter extends BaseImporter<Row, Cell> { protected boolean containsStringValue(Row row, String value) { if (row == null || !row.iterator().hasNext()) { return false; } boolean found = false; for (int i = row.getFirstCellNum(); !found && i < row.getLastCellNum(); i++) { if (row.getCell(i) != null) { try { found = value.equalsIgnoreCase(row.getCell(i).getStringCellValue()); } catch (Exception ex) { } } } return found; }  @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 testContainsStringValue() throws IOException { byte[] bytes = readFile("importertest.xlsx"); Workbook wb = importer.createWorkbook(bytes); Sheet sheet = wb.getSheetAt(0); assertTrue(importer.containsStringValue(sheet.getRow(0), "Bas")); assertFalse(importer.containsStringValue(sheet.getRow(0), "Bob")); assertFalse(importer.containsStringValue(null, "Bas")); }