@SuppressWarnings("unchecked") static <T>void subscribe(Subscriber<? super T> s,Iterator<? extends T> it){
  if (it == null) {
    Operators.error(s,new NullPointerException("The iterator is null"));
    return;
  }
  boolean b;
  try {
    b=it.hasNext();
  }
 catch (  Throwable e) {
    Operators.error(s,Operators.onOperatorError(e));
    return;
  }
  if (!b) {
    Operators.complete(s);
    return;
  }
  if (s instanceof ConditionalSubscriber) {
    s.onSubscribe(new IterableSubscriptionConditional<>((ConditionalSubscriber<? super T>)s,it));
  }
 else {
    s.onSubscribe(new IterableSubscription<>(s,it));
  }
}

@ SuppressWarnings ( "unchecked" ) static < T > void subscribe ( Subscriber < ? super T > s , Iterator < ? extends T > it ) { if ( it == null ) { Operators . error ( s , new NullPointerException ( "The iterator is null" ) ) ; return ; } boolean b ; try { b = it . hasNext ( ) ; } catch ( Throwable e ) { Operators . error ( s , Operators . onOperatorError ( e ) ) ; return ; } if ( ! b ) { Operators . complete ( s ) ; return ; } if ( s instanceof ConditionalSubscriber ) { s . onSubscribe ( new IterableSubscriptionConditional < > ( ( ConditionalSubscriber < ? super T > ) s , it ) ) ; } else { s . onSubscribe ( new IterableSubscription < > ( s , it ) ) ; } }
common method to take an iterator as a source of values .
