private int indexOf ( List < Block > targetBlocks , Block block ) { int pos = 0 ; for ( Block targetBlock : targetBlocks ) { // Test a non deep equality if ( blockEquals ( targetBlock , block ) ) { return pos ; } pos ++ ; } return - 1 ; }
Shallow indexOf implementation that only compares nodes based on their data and not their children data .