code: private static Type cleanupTypeForComparison(final Type type) {
          final Type res = GenericsUtils.resolveTypeVariables(type, IgnoreGenericsMap.getInstance());
          return res instanceof Class ? TypeUtils.wrapPrimitive((Class) res) : res;
      }
docs: Important step because consequent logic should not fail due to unknown generic. Due to java autoboxing
  we can analyze only wrapper classes in order to properly find base types (in real life, resulted types
  would be assignable: e.g. {@code Number num = (int) someInt}.
  
  @param type type to prepare for comparison
  @return type without variables (resolved by upper bound) and wrapper class if type is primitive