title: Simple Dependency injection not working
body: <p>It's the first time I have to use Dependency Injection and I'm a little confused.</p>
  
  <p>I don't really understand how it works.</p>
  
  <p>I have tried on a simple example :</p>
  
  <pre><code>public class StockResponse extends Response
  {
      @Inject BrandService $brand;
  
      public List&lt;StockResponseItem&gt; stock;
  
      public StockThresholdResponse()
      {
          stock = new ArrayList&lt;&gt;();
      }
  
      public static StockThresholdResponse create(List&lt;DataItem&gt; data)
      {
          StockResponse stock= new StockResponse();
  
          for (ThresholdCheckAggregate data: d)
          {
              StockResponseItem item = new StockResponseItem();
  
              item.id = d.thresholdId;
              item.brand = str.$brand.byId(d.brand);
  
              str.stockThresholds.add(item);
          }
          return str;
      }
  }
  </code></pre>
  
  <p>But when I use my <code>create()</code> method, I get a null pointer exception for <code>$brand</code>.</p>
  
  <p>I think I have misunderstood how DI works but I can't find my error.</p>