code: @Override
      public Iterator<Object[]> getDataByFilter(DataProviderFilter dataFilter)
              throws IOException {
          logger.entering(dataFilter);
          InputStream inputStream = resource.getInputStream();
          Yaml yaml = constructYaml(resource.getCls());
  
          Object yamlObject;
  
          // Mark the input stream in case multiple documents has been detected
          // so we can reset it.
          inputStream.mark(100);
  
          try {
              yamlObject = yaml.load(inputStream);
          } catch (ComposerException composerException) {
              String msg = composerException.getMessage();
              msg = (msg == null) ? "" : msg;
              if (msg.toLowerCase().contains("expected a single document")) {
                  inputStream.reset();
                  yamlObject = loadDataFromDocuments(yaml, inputStream);
              } else {
                  throw new DataProviderException("Error reading YAML data", composerException);
              }
          }
          return DataProviderHelper.filterToListOfObjects(yamlObject, dataFilter).iterator();
      }
docs: Gets yaml data by applying the given filter. Throws {@link DataProviderException} when unexpected error occurs
  during processing of YAML file data by filter
  
  @param dataFilter
  an implementation class of {@link DataProviderFilter}
  @return An iterator over a collection of Object Array to be used with TestNG DataProvider
  @throws IOException