title: How to invoke private method via Reflection when parameter of method is List?
body: <p>How can I invoke private method via Reflection API?</p>
  
  <p>My code</p>
  
  <pre><code>public class A {
      private String method(List&lt;Integer&gt; params){
          return "abc";
      }
  }
  </code></pre>
  
  <p>And test</p>
  
  <pre><code>public class B {
      public static void main(String[] args) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
          Class&lt;A&gt; clazz = A.class;
          Method met = clazz.getMethod("method", List.class);
          met.setAccessible(true);
          String res = (String) met.invoke("method", new ArrayList&lt;Integer&gt;());
          System.out.println(res);
      }
  }
  </code></pre>