title: Java8 list<T> to list<object[]>
body: <p>How to parse Generic to Object[] by using stream?
  I've had</p>
  
  <pre><code>private static &lt;T&gt; List&lt;Object[]&gt; selectData(List&lt;T&gt; a,
      Predicate&lt;T&gt; predicate) {
      ArrayList&lt;Object[]&gt; tmp = new ArrayList&lt;Object[]&gt;();
      for (T x : a) {
        if (predicate.test(x)) {
          tmp.add(new Object[] { x });
        }
      }   
  return tmp;
  }
  </code></pre>
  
  <p>but i want to do something like:</p>
  
  <pre><code>...//    
  return a.stream().filter(predicate).collect(Collectors.toList());
  </code></pre>
  
  <p>but i do not know how to do casting each element to Object[]</p>