int state = model.getState(); if (state != NEW && state != READY) throw new IllegalStateException("This method should only be " + "invoked in the NEW or READY state.");
switch (model.getState()) { case READY: case NEW: break; default: throw new IllegalStateException("This method should only be " + "invoked in the READY or NEW state."); }
    public void removeObject(DataObject object)    {        int state = model.getState();        if (state != NEW && state != READY)            throw new IllegalStateException("This method should only be " +                    "invoked in the NEW or READY state.");        model.fireDataObjectDeletion(object);        fireStateChange();    }