title: How do I Construct a list on the fly and pass it as a method parameter?
body: <p>I have a a method like this : </p>
  
  <pre><code>List &lt; Object &gt; getObjects(List&lt;Integer&gt; ids)
  </code></pre>
  
  <p>I want to construct a list on the fly (as a parameter) using an integer (say some int a) instead of creating and storing a list in a local variable and then passing it.</p>
  
  <pre><code>List&lt;Integer&gt; intList = new ArrayList&lt;Integer&gt;();
  intList.add(a);
  getObjects(intList)
  </code></pre>
  
  <p>How do i do this? </p>