title: Type mismatch with Iterator interface
body: <p>I have a problem with an interface. I have an Iterator interface like this:</p>
  
  <pre><code>package com.wrox.algorithms.iteration;
  import com.wrox.algorithms.lists.IteratorOutOfBoundsException;
  
  public interface Iterator {
      public void first();
      public void last();
      public void isDone();
      public void next();
      public Object current() throws IteratorOutOfBoundsException;
  }
  </code></pre>
  
  <p>After that I create test class and test the iteration in an empty list:</p>
  
  <pre><code>package com.wrox.algorithms.lists;
  import com.wrox.algorithms.iteration.Iterator;
  
  .....
  
  public void testForwardIteration() {
      Lists list = createList();
  
      Iterator iterator = list.iterator(); // &lt;- ERROR
  }
  </code></pre>
  
  <p>I get this error:</p>
  
  <blockquote>
    <p>Type mismatch: cannot convert from java.util.Iterator to com.wrox.algorithms.iteration.Iterator</p>
  </blockquote>
  
  <p>Have you any idea where my mistake is? Thank you for your support!</p>