title: Why are Iterable<E> and Iterator<E> in different packages?
body: <p><code>Iterable&lt;E&gt;</code> is in <code>java.lang</code> whereas <code>Iterator&lt;E&gt;</code> is in <code>java.util</code>. Is there a good reason for this or is this merely an artifact of bad design?</p>
  
  <p>It seems strange since the only thing that an <code>Iterable&lt;E&gt;</code> is good for is providing an <code>Iterator&lt;E&gt;</code>.</p>
  
  <p><strong>EDIT</strong>: One potential reason is because of the (then-)newly introduced for-each loop. I guess my question then would be, are they equivalent?</p>
  
  <pre><code>for(Object o : collection)
      ...
  vs
  for( Iterator iter = collection.iterator(); iter.hasNext(); ) {
      o = iter.next();
      ...
  </code></pre>
  
  <p>If they are, then that still doesn't explain why the two classes are in different packages since the compiler would have to import <code>java.util</code> anyways to use the <code>Iterator</code> construct.</p>