code: private static boolean nonEmptyIntersection(String[] a, String[] b) {
      if (a == null || b == null || a.length == 0 || b.length == 0) {
        return false;
      }
      for (String toFind : a) {
        if (contains(b, toFind)) {
          return true;
        }
      }
      return false;
    }
docs: An N*M intersection that terminates if any intersection is found. The sizes of both
  arguments are assumed to be so small, and the likelihood of an intersection so great, that it
  is not worth the CPU cost of sorting or the memory cost of hashing.