code: private static Tuple2<Integer, Integer> commonPrefixSuffixLengths(List<?> l1, List<?> l2) {
          int n1 = l1.size();
          int n2 = l2.size();
  
          if(n1 == 0 || n2 == 0) {
              return Tuples.t(0, 0);
          }
  
          int pref = commonPrefixLength(l1, l2);
          if(pref == n1 || pref == n2) {
              return Tuples.t(pref, 0);
          }
  
          int suff = commonSuffixLength(l1, l2);
  
          return Tuples.t(pref, suff);
      }
docs: Copy of org.reactfx.util.Lists.commonPrefixSuffixLengths()
  that uses reference comparison instead of equals().