code: private static boolean isAssignableFrom(TypeVariable<?> type1, TypeVariable<?> type2) {
          if (type1.equals(type2)) {
              return true;
          }
          // if a type variable extends another type variable, it cannot declare other bounds
          if (type2.getBounds()[0] instanceof TypeVariable<?>) {
              return isAssignableFrom(type1, (TypeVariable<?>) type2.getBounds()[0]);
          }
          return false;
      }
docs: Returns <tt>true</tt> if <tt>type2</tt> is a "sub-variable" of <tt>type1</tt>, i.e. if they are equal or if
  <tt>type2</tt> (transitively) extends <tt>type1</tt>.