title: Guice config error: Could not find a suitable constructor
body: <p>I have class that I am trying to instantiate via Guice but I am getting:</p>
  
  <p><code>Could not find a suitable constructor in com.workspace.myclass. Classes must have either one (and only one) constructor annotated with @Inject or a zero-argument constructor that is not private.</code></p>
  
  <p>My code looks something like:</p>
  
  <pre><code>public class MyModule extends AbstractModule {
  
      @Override
      protected void configure() { }
  
      myClass&lt;obj&gt; getMyClass(arg1, arg2) {
          Object someObj = new someObj(arg1);
          return myClass&lt;&gt;(someObj, s -&gt; new Obj(arg2, s.getMethod()));
      }
  }
  
  public myClass&lt;T extends someClass&gt; {
  
      public myClass(arg1, Function&lt;obj&lt;T&gt;, obj2&lt;T&gt;&gt; arg2) {
  
      }
  
  }
  
  public static void main(args[]) {
  
      Injector injector = createInjector(new MyModule());
      MyClass myClass = injector.getInstance(MyClass.class);
  }
  </code></pre>
  
  <p>Is Guice unable to resolve the lambda to the constructor for MyClass?</p>