title: Java: Instantiate a generic type by returning a Supplier vs returning a new instance
body: <p>I was reading how to instantiate a generic and after reading and applying <a href="https://stackoverflow.com/a/36315051/3399416">this answer</a>; I would like to know what would be the differences between expecting a <code>Supplier&lt;T&gt;</code> vs. expecting a new instance of <code>T</code>.</p>
  
  <p>Example:</p>
  
  <pre><code>abstract class AbstractService&lt;T extends AbstractEntity&gt; {
      protected Supplier&lt;T&gt; makeNewThing();  // supplier is expected
  
      public T myMethod(){
          T object = makeNewThing().get(); // local object by calling supplier
          object.doStuff();
          return object;
      }
  }
  
  class CarService extends AbstractService&lt;Car&gt; {
      public Supplier&lt;Car&gt; makeNewThing(){
          return Car::new;
      }
  }
  </code></pre>
  
  <p>vs.</p>
  
  <pre><code>abstract class AbstractService&lt;T extends SomeAbstractEntity&gt; {
      protected T makeNewThing();  // object is expected, newness is assumed
  
      public T myMethod(){
          T object = makeNewThing(); // local object by calling constructor
          object.doStuff();
          return object;
      }
  }
  
  class CarService extends AbstractService&lt;Car&gt; {
      public Car makeNewThing(){
          return new Car();
      }
  }
  </code></pre>
  
  <p>The only thing I can think of is that expecting a supplier ensures that a new object will be created, but when expecting an object we can only assume that the implementing classes are calling the constructor and not re-using an existing instance. </p>
  
  <p>I'd like to know of other <strong>objective differences and possible use cases</strong>, if any. Thanks in advance.</p>