code: public static Type build(final Type one,
                               final Type two,
                               final boolean alwaysIncludeInterfaces) {
          // get rid of possible variables
          final Type first = cleanupTypeForComparison(one);
          final Type second = cleanupTypeForComparison(two);
  
          final Type res = buildImpl(first, second, alwaysIncludeInterfaces, new PathsCache());
          // during resolution wildcard types may be used as temporal placeholders (to prevent cycles)
          // and after resolution there might be wildcards with only one upper bound
          // so we need to repackage type to get rid of such wildcards
          return GenericsUtils.resolveTypeVariables(res, EmptyGenericsMap.getInstance());
      }
docs: Builds median type for provided types. {@link TypeUtils#getCommonType(Type, Type)} must be used in most
  cases instead this direct call. Direct call is suitable only if less precise type is required (base class only).
  <p>
  Actually, interface restriction is used even in full types resolution because of possible loops.
  For example, common type for {@link Integer} and {@link Double} is
  {@code ? extends Number and Comparable<Number>}, but if we will use maximum precision for interface resolution
  we will get loop because {@code Comparable} generic resolution is again require common type for {@link Integer}
  and {@link Double}. To solve this, interface generics are resolved only till exact type.
  <p>
  Note that if we apply restricted resolution also for main types it will reduce accuracy (e.g.
  just {@link Number} in example above), which may greatly reduce accuracy in multiple types comparision
  (e.g. {@code Integer and Double and Comparable} (sequential match): when interfaces included result is
  {@code Comparable} and without interfaces it's {@code Object}).
  <p>
  When resolution lead to multiple types (most likely, class + interfaces) they will be ordered as:
  class, interface from non java package, interface with generics, by class name (without package).
  
  @param one                     first type
  @param two                     second type
  @param alwaysIncludeInterfaces true to resolve not only base class but also all common interfaces, false
  to look common class only and lookup interfaces inly when no base class found
  @return maximum class assignable to both types or {@code Object} if classes are incompatible