code: @Override
      public Iterator<Object[]> getDataByFilter(DataProviderFilter dataFilter) {
          logger.entering(dataFilter);
          List<Object[]> objs = new ArrayList<>();
          Field[] fields = resource.getCls().getDeclaredFields();
  
          // Extracting number of rows of data to read
          // Notice that numRows is returning the actual number of non-blank rows.
          // Thus if there are blank rows in the sheet then we will miss some last rows of data.
          List<Row> rowToBeRead = excelReader.getAllExcelRows(resource.getCls().getSimpleName(), false);
          List<String> excelHeaderRow = getHeaderRowContents(resource.getCls().getSimpleName(), fields.length);
          for (Row row : rowToBeRead) {
              List<String> excelRowData = excelReader.getRowContents(row, fields.length);
              Map<String, String> headerRowDataMap = prepareHeaderRowDataMap(excelHeaderRow, excelRowData);
              if (excelRowData.size() != 0) {
                  try {
                      Object temp = prepareObject(getObject(), fields, excelRowData, headerRowDataMap);
                      if (dataFilter.filter(temp)) {
                          objs.add(new Object[] { temp });
                      }
                  } catch (IllegalAccessException e) {
                      throw new DataProviderException("Unable to create instance of type '" + resource.getCls().getName()
                              + "'", e);
                  }
              }
          }
          logger.exiting(objs.iterator());
          return objs.iterator();
      }
docs: Gets data from Excel sheet by applying the given filter.
  
  @param dataFilter
  an implementation class of {@link DataProviderFilter}
  @return An iterator over a collection of Object Array to be used with TestNG DataProvider