docs: private static <T> List<T> intersect(T[] first, T[] second) {
      List<T> result = new ArrayList<>();
      for (T a : first) {
        for (T b : second) {
          if (a.equals(b)) {
            result.add(b);
            break;
          }
        }
      }
      return result;
    }