code: public static List<TypeVariable> findVariables(final Type type) {
          if (type instanceof Class) {
              return Collections.emptyList();
          }
          final List<TypeVariable> res = new ArrayList<TypeVariable>();
          findVariables(type, res);
          return res;
      }
docs: Searches for generic variable declarations in type. May be used for scope checks.
  For example, in {@code List<T>} it will find "T", in {@code Some<Long, T, List<K>} "T" and "K".
  <p>
  Also detects preserved variables {@link ExplicitTypeVariable} (used for tracking).
  
  @param type type to analyze.
  @return list of generic variables inside type or empty list