code: private static void analyzeInterface(final Map<Class<?>, LinkedHashMap<String, Type>> types,
                                           final Map<Class<?>, LinkedHashMap<String, Type>> knownTypes,
                                           final Type iface,
                                           final Class<?> hostType,
                                           final List<Class<?>> ignoreClasses) {
          final Class interfaceType = iface instanceof ParameterizedType
                  ? (Class) ((ParameterizedType) iface).getRawType()
                  : (Class) iface;
          if (!ignoreClasses.contains(interfaceType)) {
              if (knownTypes.containsKey(interfaceType)) {
                  // check possibly already resolved generics (if provided externally)
                  types.put(interfaceType, knownTypes.get(interfaceType));
              } else if (iface instanceof ParameterizedType) {
                  final ParameterizedType parametrization = (ParameterizedType) iface;
                  final LinkedHashMap<String, Type> generics =
                          resolveGenerics(parametrization, types.get(hostType));
  
                  if (types.containsKey(interfaceType)) {
                      // class hierarchy may contain multiple implementations for the same interface
                      // in this case we can merge known generics, using most specific types
                      // (root type unifies interfaces, so we just collecting actual maximum known info
                      // from multiple sources)
                      merge(interfaceType, generics, types.get(interfaceType));
                  }
                  types.put(interfaceType, generics);
              } else if (interfaceType.getTypeParameters().length > 0) {
                  // root class didn't declare generics
                  types.put(interfaceType, resolveRawGenerics(interfaceType));
              } else if (!GROOVY_OBJECT.equals(interfaceType.getSimpleName())) {
                  // avoid groovy specific interface (all groovy objects implements it)
                  types.put(interfaceType, EmptyGenericsMap.getInstance());
              }
              analyzeType(types, interfaceType, knownTypes, ignoreClasses);
          }
      }
docs: Analyze interface generics. If type is contained in known types - no generics resolution performed
  (trust provided info).
  
  @param types         resolved generics of already analyzed types
  @param knownTypes    type generics known before analysis (some middle class generics are known)
  @param iface         interface to analyze
  @param hostType      class implementing interface (where generics actually defined)
  @param ignoreClasses classes to ignore during analysis