code: public synchronized InstanceStatus setStatus(InstanceStatus status) {
          if (this.status != status) {
              InstanceStatus prev = this.status;
              this.status = status;
              setIsDirty();
              return prev;
          }
          return null;
      }
docs: Set the status for this instance.
  
  @param status status for this instance.
  @return the prev status if a different status from the current was set, null otherwise