code: private int countOverlap(CharSequence c1, int start1, 
                               CharSequence c2, int start2) {
          // The maxium overlap is the number of characters in the sequences
  	int maxOverlap = Math.min(c1.length() - start1, c2.length() - start2);
  	int overlap = 0;
  	for (; overlap < maxOverlap; ++overlap) {
  	    if (c1.charAt(overlap + start1) != c2.charAt(overlap + start2)) {
  		break;
  	    }
  	}
  	return overlap;
      }
docs: Returns the number of overlapping characters between {@code c1} and
  {@code c2} starting and the provided indices into the sequences.
  
  @param c1 a character sequence
  @param start1 the index into {@code c1} at which the overlap test should
  start
  @param c2 a character sequence
  @param start2 the index into {@code c2} at which the overlap test should
  start
  
  @return the number of characters shared by both sequences when viewed at
  the provided starting indices.