class ResolveOrgan implements Runnable {

    @Override
    public void run() {
        //resolveorgan -u 1 -o liver -r "input error"
        Optional<Client> optionalClient = manager.getClientByID(uid);
        Client client;
        if (!optionalClient.isPresent()) {
            outputStream.println("No client exists with that user ID");
            return;
        } else {
            client = optionalClient.get();
        }

        TransplantRequest selectedTransplantRequest = null;

        // Iterate through each transplant request for the client,
        // checking if the client has requested that organ.
        // If they have, the request is stored in selectedTransplantRequest.
        // Otherwise, it will remain null.
        for (TransplantRequest tr : client.getTransplantRequests()) {
            if (tr.getRequestedOrgan() == organType && tr.getStatus() == TransplantRequestStatus.WAITING) {
                selectedTransplantRequest = tr;
                break;
            }
        }

        if (selectedTransplantRequest == null) {
            outputStream.println(client.getFullName() + " is not currently requesting this organ.");
        } else {
            resolveRequest(selectedTransplantRequest);
        }
    }

    public  ResolveOrgan(PrintStream outputStream, ActionInvoker invoker);
    public  ResolveOrgan(ClientManager manager, ActionInvoker invoker);

}