code: public static Type build(final Object... instances) {
          final Object[] objects = filterNulls(instances);
  
          if (objects.length == 0) {
              // null assignable to anything (as Object in assignability logic)
              return Object.class;
          }
  
          final Type median = getMedianType(objects);
          final Class<?> type = GenericsUtils.resolveClass(median);
  
          return type.isArray() ? buildArrayType(median, instances) : buildType(median, objects);
      }
docs: Construct {@link ru.vyarus.java.generics.resolver.util.type.instance.InstanceType} for provided instance(s).
  <p>
  Returned type may not be an instance type, if further analysis is impossible:
  <ul>
  <li>If all instances are null {@code Object} returned</li>
  <li>If instance is empty array then array class returned</li>
  <li>If multiple empty arrays provided then median array type returned (for primitive arrays it would
  always be wrapper class)</li>
  </ul>
  
  @param instances instances to build type for
  @return instance type if non null instances present or simple class (arrays class or just {@code Object})