private int estimateNumIterations(Object[] dataProviders) {
    if (runStatus != OK) return -1;
    if (dataProviders.length == 0) return 1;

    int result = Integer.MAX_VALUE;
    for (Object prov : dataProviders) {
      if (prov instanceof Iterator)
        // unbelievably, DGM provides a size() method for Iterators,
        // although it is of course destructive (i.e. it exhausts the Iterator)
        continue;

      Object rawSize = GroovyRuntimeUtil.invokeMethodQuietly(prov, "size");
      if (!(rawSize instanceof Number)) continue;

      int size = ((Number) rawSize).intValue();
      if (size < 0 || size >= result) continue;

      result = size;
    }

    return result == Integer.MAX_VALUE ? -1 : result;
  }
private int estimateNumIterations ( Object [ ] dataProviders ) { if ( runStatus != OK ) return - 1 ; if ( dataProviders . length == 0 ) return 1 ; int result = Integer . MAX_VALUE ; for ( Object prov : dataProviders ) { if ( prov instanceof Iterator ) continue ; Object rawSize = GroovyRuntimeUtil . invokeMethodQuietly ( prov , "size" ) ; if ( ! ( rawSize instanceof Number ) ) continue ; int size = ( ( Number ) rawSize ) . intValue ( ) ; if ( size < 0 || size >= result ) continue ; result = size ; } return result == Integer . MAX_VALUE ? - 1 : result ; }
-1 => unknown