docs: public static <T> Collection<T> intersect(Collection<T> left, Collection<T> right, Comparator<T> comparator) {
          if (left.isEmpty() || right.isEmpty())
              return createSimilarCollection(left, 0);
  
          Collection<T> result = createSimilarCollection(left, Math.min(left.size(), right.size()));
          //creates the collection to look for values.
          Collection<T> pickFrom = new TreeSet<T>(comparator);
          pickFrom.addAll(left);
  
          for (final T t : right) {
              if (pickFrom.contains(t))
                  result.add(t);
          }
          return result;
      }