title: Determine if a Class implements a interface in Java
body: <p>I have a <code>Class</code> object. I want to determine if the type that the <code>Class</code> object represents implements a specific interface. I was wondering how this could be achieved?</p>
  
  <p>I have the following code. Basically what it does is gets an array of all the classes in a specified package. I then want to go through the array and add the Class objects that implement an interface to my map. Problem is the <code>isInstance()</code> takes an object as a parameter. I can't instantiate an interface. So I am kind of at a loss with this. Any ideas?</p>
  
  <pre><code>Class[] classes = ClassUtils.getClasses(handlersPackage);
  for(Class clazz : classes)
  {
      if(clazz.isInstance(/*Some object*/)) //Need something in this if statement
      {
          retVal.put(clazz.getSimpleName(), clazz);
      }
  }
  </code></pre>