question: @ SuppressWarnings ( "unchecked" ) public static < T > T findValueOfType ( Collection < ? > collection , Class < T > type ) { if ( isEmpty ( collection ) ) { return null ; } T value = null ; for ( Object element : collection ) { if ( type == null || type . isInstance ( element ) ) { if ( value != null ) { return null ; } value = ( T ) element ; } } return value ; }
target:  Find a single value of the given type in the given Collection.