public static int searchForIndex(List<?> list, Object item) {
    """
	Does a binary search
	
	
	NOTE THIS WILL NOT SORT THE LIST ASCENDING.
	
	@param list list you are searching
	@param item the item you are searching for
	@return the index of the item
    """

        if (list.size()>1) {

            Object o = list;
            return  Collections.binarySearch((List<? extends Comparable<? super Object>>) o, item);
        } else {
            return -1;
        }
    }
public static int searchForIndex(List<?> list, Object item) {

        if (list.size()>1) {

            Object o = list;
            return  Collections.binarySearch((List<? extends Comparable<? super Object>>) o, item);
        } else {
            return -1;
        }
    }
public static int searchForIndex ( List < ? > list , Object item ) { if ( list . size ( ) > 1 ) { Object o = list ; return Collections . binarySearch ( ( List < ? extends Comparable < ? super Object > > ) o , item ) ; } else { return - 1 ; } }
Does a binary search


NOTE THIS WILL NOT SORT THE LIST ASCENDING.

@param list list you are searching
@param item the item you are searching for
@return the index of the item
Does a binary search