title: Java Guice - the method toProvider is not applicable for the arguments
body: <p>I am following Guice documentation from here:
  <a href="http://code.google.com/p/google-guice/" rel="nofollow">http://code.google.com/p/google-guice/</a></p>
  
  <p>and I'm stuck at <code>toProvider</code> method. When I try to do this:</p>
  
  <p><code>bind(Shape.class).toProvider(ShapeProvider.class);</code></p>
  
  <p>I get this error:</p>
  
  <p><code>The method toProvider(Provider&lt;? extends Shape&gt;) in the type LinkedBindingBuilder&lt;Shape&gt; is not applicable for the arguments (Class&lt;ShapeProvider&gt;)</code></p>
  
  <p>My code below:</p>
  
  <p><strong>Configuration class</strong></p>
  
  <pre><code>public class Configuration extends AbstractModule{
      @Override
      protected void configure(){
          bind(Shape.class).toProvider(ShapeProvider.class);
          bind(Triangle.class).to(IsoTriangle.class);
      }
  </code></pre>
  
  <p><strong>ShapeProvider class</strong></p>
  
  <pre><code>public class ShapeProvider implements Provider&lt;Shape&gt; {
      private int length;
      @Inject
      public ShapeProvider(int length){
          this.length = length;
      }
      public Shape get(){
          Shape triangle = new Triangle(length);
          return triangle;
  
      }
  }
  </code></pre>
  
  <p><strong>Shape interface</strong></p>
  
  <pre><code>public interface Shape {
  
  }
  </code></pre>
  
  <p><strong>Triangle class</strong></p>
  
  <pre><code>public class Triangle implements Shape{
      int length;
      public Triangle(){
      }
      public Triangle(int lenght){
          this.length = lenght;
      }
  }
  </code></pre>
  
  <p>Do I miss something or there is something that is not mentioned in documentation?</p>
  
  <p><strong>Update:</strong></p>
  
  <p><strong>Provider interface:</strong></p>
  
  <pre><code>public interface Provider&lt;T&gt; {
      T get();
  }
  </code></pre>