title: Java reflection - checking method parameter type
body: <p>I'm using this code in order to check a method parameters type and it doesn't seem to work.</p>
  
  <p>Any ideas what am I not doing right?</p>
  
  <pre><code>Class&lt;?&gt;[] parameter_types = m.getParameterTypes();
  if (parameter_types[0].equals(Integer.class)) {
     // DO SOMETHING
  }
  </code></pre>
  
  <p><code>m</code> is a method with integer type parameter:</p>
  
  <pre><code>public void m(int param);
  </code></pre>