title: Java CompareTo method states I cannot convert int to boolean even though neither is used
body: <pre><code>public int compareTo(Person p) {
      int res = 1;
      String personStr = p.getId();
      String thisId = this.getId();
  
      if(thisId.equals(personStr)){
          res = 0;
      }
      else if(thisId.compareTo(personStr)){
          res = -1;
      }
  
      return res;
  }
  </code></pre>
  
  <p>A quite simple compareTo method I have implemented but I don't get the error message. The condition in the else if statemint gives me a message saying that it can't convert from int to boolean. I get that, but the thing is that I'm using netiher. I just want to compare 2 simple strings, why does this happen?</p>