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;
}

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 ; }
checks whether a list contains a particular resource id .
