Integer thisId = this.getId(); Integer otherId = other.getId(); comparisonResult = thisId.compareTo(otherId);
Integer thisId = null; Integer otherId = null; if (null == (thisId = this.getId())) comparisonResult = -1; else if (null == (otherId = other.getId())) comparisonResult = 1;
  public int compareTo(Object o)  {    Proxy other = (Proxy)o;    int comparisonResult;        PrivilegedSubject thisGrantee = this.getGrantee();    PrivilegedSubject otherGrantee = other.getGrantee();    comparisonResult = thisGrantee.compareTo(otherGrantee);        if (comparisonResult != 0)    {      return comparisonResult;    }        Subsystem thisSubsystem = this.getSubsystem();    Subsystem otherSubsystem = other.getSubsystem();        if (thisSubsystem == otherSubsystem)    {      comparisonResult = 0;    }    else if (thisSubsystem != null)    {      comparisonResult = thisSubsystem.compareTo(otherSubsystem);    }    else    {      comparisonResult = -1;    }        if (comparisonResult != 0)    {      return comparisonResult;    }        // This last clause is here to distinguish two Proxies which are     // otherwise identical twins:        Integer thisId = this.getId();    Integer otherId = other.getId();    comparisonResult = thisId.compareTo(otherId);    return comparisonResult;  }