code: public static Type getGenericClassType(Class clazz, Class filterClass)
      {
          for (Type type : clazz.getGenericInterfaces()) {
              if (type == filterClass) {
                  return type;
              } else if (type instanceof ParameterizedType) {
                  ParameterizedType pType = (ParameterizedType) type;
                  if (filterClass.isAssignableFrom((Class) pType.getRawType())) {
                      return type;
                  }
              }
          }
  
          return null;
      }
docs: Extract the real Type from the passed class. For example
  <tt>public Class MyClass implements FilterClass&lt;A, B&gt;, SomeOtherClass&lt;C&gt;</tt> will return
  <tt>FilterClass&lt;A, B&gt;, SomeOtherClass&lt;C&gt;</tt>.
  
  @param clazz the class to extract from
  @param filterClass the class of the generic type we're looking for
  @return the real Type from the interfaces of the passed class, filtered by the passed filter class
  @since 4.0M1