Determine the index where two lists diverge
Some notes:


Use ArrayList. LinkedList is not random access list. LinkedList#get(index) has O(n), ArrayList#get(index) has O(1)
The second check valid(this) is not required
Use Iterator to avoid (index &lt; size()) &amp;&amp; (index &lt; list.size())
Not sure it is really necessary to define a new Class. Simple static util method can also do the job
Avoiding “!= null” statements in Java?


Example:

static int firstMismatch(List&lt;?&gt; original, List&lt;?&gt; other) {

    int index      = -1;
    Iterator&lt;?&gt; it = other.iterator();

    for(Object el : original){

        ++index;

        if(!(it.hasNext() &amp;&amp; el.equals(it.next()))){
            return index;
        } 
    }

    // TODO: other.size() &gt; original.size()
    return it.hasNext() ? (index + 1) : -1; 
}


Prints: 

Original: [name, first, middle, last, maiden]
Other:    [name, first, middle, last, maiden]
-1
---------
Original: [name, middle, last]
Other:    [name, first, middle, last, maiden]
1
---------
Original: [name, middle, last, maiden, honorific]
Other:    [name, middle, last]
3
---------
Original: []
Other:    []
-1
---------
Original: [name]
Other:    [address]
0
---------
Original: [name]
Other:    [name, address]
1 // TODO: original has only 1 element




For completeness, another approach is to determine the list with fewer items, then iterate against the larger of the two, and exit when no more matches are found:

public int diverges( DivergentList&lt;E&gt; list ) {
  int index = -1;

  // Determine the larger list for iterating.
  boolean smaller = list.size() &lt; this.size();

  Iterator&lt;E&gt; iFew = (smaller ? list : this).iterator();

  // Iterate over the larger list.
  for( E e : (smaller ? this : list) ) {
    // Terminate when no more items exist in the smaller list.
    if( !(iFew.hasNext() &amp;&amp; e.equals( iFew.next() )) ) {
      break;
    }

    index++;
  }

  return index;
}


This introduces a new variable, uses a single return statement, eliminates a final return calculation, and ensures list1.diverges( list2 ) == list2.diverges( list1 ) is always true.

The revised code prints:

Original: [name, first, middle, last, maiden]
Other:    [name, first, middle, last, maiden]
4
---------
Original: [name, middle, last]
Other:    [name, first, middle, last, maiden]
0
---------
Original: [name, middle, last, maiden, honorific]
Other:    [name, middle, last]
2
---------
Original: []
Other:    []
-1
---------
Original: [name]
Other:    [address]
-1
---------
Original: [name]
Other:    [name, address]
0


In this case, the return values indicate the last common index, which allows an empty list to be differentiated from an equal list.