private static < C extends Compound > int getIndexOfCompound ( List < C > list , C compound ) { int index = list . indexOf ( compound ) ; if ( index == - 1 ) { for ( int i = 0 ; i < list . size ( ) ; i ++ ) { if ( compound . equalsIgnoreCase ( list . get ( i ) ) ) { index = i ; break ; } } } return index ; }
Returns the index of the first occurrence of the specified element in the list . If the list does not contain the given compound the index of the first occurrence of the element according to case - insensitive equality . If no such elements exist - 1 is returned .