code: public static Class<?> resolveClass(final Type type, final Map<String, Type> generics) {
          final Class<?> res;
          if (type instanceof Class) {
              res = (Class) type;
          } else if (type instanceof ExplicitTypeVariable) {
              res = resolveClass(((ExplicitTypeVariable) type).getBounds()[0], generics);
          } else if (type instanceof ParameterizedType) {
              res = resolveClass(((ParameterizedType) type).getRawType(), generics);
          } else if (type instanceof TypeVariable) {
              res = resolveClass(declaredGeneric((TypeVariable) type, generics), generics);
          } else if (type instanceof WildcardType) {
              final Type[] upperBounds = ((WildcardType) type).getUpperBounds();
              res = resolveClass(upperBounds[0], generics);
          } else {
              res = ArrayTypeUtils.toArrayClass(
                      resolveClass(((GenericArrayType) type).getGenericComponentType(), generics));
          }
          return res;
      }
docs: Resolves top class for provided type (for example, for generified classes like {@code List<T>} it
  returns base type List).
  <p>
  Note: may return primitive because it might be important to differentiate actual value.
  Use {@link TypeUtils#wrapPrimitive(Class)} to box possible primitive, if required.
  
  @param type     type to resolve
  @param generics root class generics mapping
  @return resolved class
  @throws UnknownGenericException when found generic not declared on type (e.g. method generic)
  @see #resolveClass(Type) shortcut for types without variables
  @see #resolveClassIgnoringVariables(Type) shortcut to resolve class ignoring passible variables