title: How do I supply an argument to a parameterized method, whose type I don't know until runtime?
body: <p>In this code snippet:</p>
  
  <pre><code>...
  Executor&lt;? extends Data&gt; executor = someOtherThing.getExecutor();
  Data data = someOtherOtherThing.getData();
  
  executor.execute(data);
  ...
  
  interface Executor&lt;T extends Data&gt; {
      void execute(T data);
  }
  </code></pre>
  
  <p>So both the <code>executor</code> and the <code>data</code> are coming in from somewhere else, and I don't know their actual types until run time, but I do know that the type of <code>data</code> is the same as <code>executor</code>'s parameterised type, <code>T</code>. </p>
  
  <p>I assume that some sort of cast is needed to allow <code>executor.execute(data)</code>, but I don't know what to cast to, or how to do it, without knowing the exact type until runtime. How can I make this happen?</p>
  
  <p>Thank you!</p>