question: private boolean checkResource ( Collection < Integer > list , int id ) { boolean flag = false ; if ( list == null || id < 0 ) { return flag ; } Integer obj = null ; Iterator < Integer > it = list . iterator ( ) ; while ( it . hasNext ( ) ) { obj = it . next ( ) ; if ( obj . intValue ( ) == id ) { flag = true ; break ; } } return flag ; }
target:  Checks whether a list contains a particular resource id.