private int searchFilterIndex(List<Filter> filters, int targetId, int min, int max) {
		// Basic algorithm taken from Wikipedia:
		// http://en.wikipedia.org/wiki/Binary_search_algorithm#Recursive
		if (max <= min) {
			// set is empty, so return value showing not found
			return -1;
		} 
		
		// calculate midpoint to cut set in half
		int mid = (min + max) / 2;

		// three-way comparison
		int id = filters.get(mid).getId();
		if (id > targetId) {
			// id is in lower subset
			return searchFilterIndex(filters, targetId, min, mid - 1);
		} else if (id < targetId) {
			// id is in upper subset
			return searchFilterIndex(filters, targetId, mid + 1, max);
		}
		
		// index has been found
		return mid + 1;
	}
private int searchFilterIndex ( List < Filter > filters , int targetId , int min , int max ) { if ( max <= min ) { return - 1 ; } int mid = ( min + max ) / 2 ; int id = filters . get ( mid ) . getId ( ) ; if ( id > targetId ) { return searchFilterIndex ( filters , targetId , min , mid - 1 ) ; } else if ( id < targetId ) { return searchFilterIndex ( filters , targetId , mid + 1 , max ) ; } return mid + 1 ; }
ZAP: Added the method.