code: public static Type[] getGenerics(final Type type, final Map<String, Type> generics) {
          Type[] res = NO_TYPES;
          Type analyzingType = type;
          if (type instanceof TypeVariable) {
              // if type is pure generic recovering parametrization
              analyzingType = declaredGeneric((TypeVariable) type, generics);
          }
          if ((analyzingType instanceof ParameterizedType)
                  && ((ParameterizedType) analyzingType).getActualTypeArguments().length > 0) {
              res = ((ParameterizedType) analyzingType).getActualTypeArguments();
          } else if (type instanceof Class) {
              // if type is class return raw declaration
              final Class<?> actual = (Class<?>) analyzingType;
              if (actual.getTypeParameters().length > 0) {
                  res = GenericsResolutionUtils.resolveDirectRawGenerics(actual)
                          .values().toArray(new Type[0]);
              }
          }
          return res;
      }
docs: If type is a variable, looks actual variable type, if it contains generics.
  For {@link ParameterizedType} return actual type parameters, for simple class returns raw class generics.
  <p>
  Note: returned generics may contain variables inside!
  
  @param type     type to get generics of
  @param generics context generics map
  @return type generics array or empty array