class SetOrganStatus implements Runnable {

    @Override
    public void run() {
        Optional<Client> client = manager.getClientByID(uid);
        if (!client.isPresent()) {
            outputStream.println("No client exists with that user ID");
            return;
        }

        ModifyClientOrgansAction action = new ModifyClientOrgansAction(client.get(), manager);

        Map<Organ, Boolean> states = new EnumMap<>(Organ.class);
        states.put(Organ.LIVER, liver);
        states.put(Organ.KIDNEY, kidney);
        states.put(Organ.PANCREAS, pancreas);
        states.put(Organ.HEART, heart);
        states.put(Organ.LUNG, lung);
        states.put(Organ.INTESTINE, intestine);
        states.put(Organ.CORNEA, cornea);
        states.put(Organ.MIDDLE_EAR, middleear);
        states.put(Organ.SKIN, skin);
        states.put(Organ.BONE, bone);
        states.put(Organ.BONE_MARROW, bonemarrow);
        states.put(Organ.CONNECTIVE_TISSUE, connectivetissue);

        for (Map.Entry<Organ, Boolean> entry : states.entrySet()) {
            Organ organ = entry.getKey();
            Boolean newState = entry.getValue();
            Boolean currState = client.get().getOrganDonationStatus().get(organ);
            if (newState == null) {
                continue;
            } else if (newState && currState) {
                outputStream.println(organ + " is already registered for donation");
            } else if (!newState && !currState) {
                outputStream.println(organ + " is already not registered for donation");
            } else {
                try {
                    action.addChange(organ, newState);
                    // This should not be thrown as we do checks before to ensure it is correct
                } catch (OrganAlreadyRegisteredException e) {
                    LOGGER.log(Level.WARNING, e.getMessage(), e);
                }
            }
        }

        outputStream.println(invoker.execute(action));
    }

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

}