code: @Pure
  	public static Class<?> getCommonType(Object instance1, Object instance2) {
  		if (instance1 == null) {
  			return instance2 == null ? null : instance2.getClass();
  		}
  		if (instance2 == null) {
  			return instance1.getClass();
  		}
  		Class<?> top = instance1.getClass();
  		while (!top.isInstance(instance2)) {
  			top = top.getSuperclass();
  			assert top != null;
  		}
  		return top;
  	}
docs: Replies the top-most type which is common to both given objects.
  
  @param instance1 first object.
  @param instance2 second object.
  @return the top-most type which is common to both given objects.
  @since 6.0