public final void checkPatientsInside(List returned){
  for (Enumeration e=inside.elements(); e.hasMoreElements(); ) {
    Patient p=(Patient)e.nextElement();
    p.timeLeft-=1;
    if (p.timeLeft == 0) {
      freePersonnel++;
      inside.delete(p);
      returned.add(p);
    }
  }
}

public final void checkPatientsInside ( List returned ) { for ( Enumeration e = inside . elements ( ) ; e . hasMoreElements ( ) ; ) { Patient p = ( Patient ) e . nextElement ( ) ; p . timeLeft -= 1 ; if ( p . timeLeft == 0 ) { freePersonnel ++ ; inside . delete ( p ) ; returned . add ( p ) ; } } }
check the patients inside the hospital to see if any are finished . if so , then free up the personnel and and the patient to the returned list .
