question: protected double generateWaitTime ( ) { if ( state == STATE_WALKING_ELSEWHERE ) { if ( location . equals ( latestBusStop ) ) { state = STATE_WAITING_FOR_BUS ; } } if ( state == STATE_TRAVELLING_ON_BUS ) { state = STATE_WAITING_FOR_BUS ; } return 0 ; }
target:  Switches state between getPath() calls