private static boolean areEqual(Object v1, Object v2) {
    if (Objects.equals(v1, v2)) return true;

    if (v1 instanceof Object[] && v2 instanceof Object[]) {
      return Arrays.deepEquals((Object[])v1, (Object[])v2);
    }

    if (v1 instanceof Reference && v2 instanceof Reference) {
      return Objects.equals(((Reference<?>)v1).get(), ((Reference<?>)v2).get());
    }

    return false;
  }
private static boolean areEqual(Object v1, Object v2)