@Contract(pure=true)
  public static int[] intersection(int @NotNull [] a1, int @NotNull [] a2) {
    if (a1.length == 0) {
      return a2;
    }
    if (a2.length == 0) {
      return a1;
    }
    IntSet result = new IntOpenHashSet(a1);
    result.retainAll(new IntArrayList(a2));
    return result.toIntArray();
  }
@Contract(pure=true)
  public static int[] intersection(int @NotNull [] a1, int @NotNull [] a2)