# Requirement change

The building manager has had enough of waiting behind the morning rush, and honestly so have the
paramedics — the same button is going to serve both. We are fitting a **priority call**.

Your contract folder has an updated `HallPanelApi` with one extra call:

    int priorityCall(int floor, Direction direction)

It is dispatched **exactly like an ordinary hall call**: same rule for choosing the lift, same
answer (the id of the lift that will come), same refusals for a floor that does not exist, a
direction of IDLE, UP from the top or DOWN from the bottom. What is different is what the chosen
lift does next.

**The lift serves that floor before any of its other pending stops.** Not "next in direction order"
— *next, full stop*. If it is on floor 4 climbing towards a call on 9 and a priority call comes in
for floor 2, it turns round, goes to 2, and only then carries on up to 9. The other stops are not
cancelled, only overtaken.

Two more things I care about:

- **Priority is spent when it is served.** Once the lift has stopped at that floor, that floor is
  ordinary again. If somebody presses it normally an hour later it takes its turn like everyone
  else. I do not want a floor that is permanently VIP because a paramedic used it once.
- **The floor shows up as a pending stop like any other**, and the lift still moves one floor per
  step and still spends a tick opening its doors. This is about the order of the queue, not about
  going faster.

If two priority calls end up on the same lift, serve the lower floor first — I do not much care
which, I care that it is the same answer every time.

Everything else is unchanged: capacity, direction order for the non-priority stops, what happens
when a lift is withdrawn, all of it.

> The updated interface file replaces the one you were given; drop it over
> `contract/HallPanelApi.java`. Adding the new method is expected to cost you a few lines, and the
> budget accounts for it.
