code: public static IType findParameterizedTypeInHierarchy( IType sourceType, IType rawGenericType )
    {
      if( sourceType == null )
      {
        return null;
      }
  
      if( sourceType.isParameterizedType() && sourceType.getGenericType().equals( rawGenericType ) )
      {
        return sourceType;
      }
  
      IType[] list = sourceType.getInterfaces();
      for( int i = 0; i < list.length; i++ )
      {
        IType returnType = findParameterizedTypeInHierarchy( list[i], rawGenericType );
        if( returnType != null )
        {
          return returnType;
        }
      }
  
      return findParameterizedTypeInHierarchy( sourceType.getSupertype(), rawGenericType );
    }
docs: Todo: the above method is nearly identical to this one. lets see about combining them