public static SimEvent select(int src,Predicate p){
  SimEvent ev=null;
  Iterator<SimEvent> iterator=deferred.iterator();
  while (iterator.hasNext()) {
    ev=iterator.next();
    if (ev.getDestination() == src && p.match(ev)) {
      iterator.remove();
      break;
    }
  }
  return ev;
}

public static SimEvent select ( int src , Predicate p ) { SimEvent ev = null ; Iterator < SimEvent > iterator = deferred . iterator ( ) ; while ( iterator . hasNext ( ) ) { ev = iterator . next ( ) ; if ( ev . getDestination ( ) == src && p . match ( ev ) ) { iterator . remove ( ) ; break ; } } return ev ; }
selects an event matching a predicate .
