title: Branch coverage in a java super class which is an abstract class
body: <p>How do I solve a cobertura branch coverage issue which is being reflected in a concrete method of an abstract class. </p>
  
  <p>In the below snippet the equals method of the abstract class Currency contains a part where there is a check for the variables SID and Ab which comes after the condition 
  if (getClass() != obj.getClass()).
  This part never gets covered</p>
  
  <pre><code>     @Override      
       public boolean equals(Object obj) {
           if (this == obj)
               return true;
           if (obj == null)
               return false;
           if (getClass() != obj.getClass())
               return false;
           if (getClass() != obj.getClass())
               return false;
           final Currency other = (Currency) obj;
           if (this.getAb() == null) {
               if (other.Ab() != null)
                   return false;
           } else if (!this.getAb().equals(other.getAb()))
               return false;
           if (this.getSID() &lt; 1 || (this.getSID() != other.getSID()))
               return false;
           return true;
           }
  </code></pre>
  
  <p>I tried to cover these variables in the test class using the below method but it still doesn't get covered:</p>
  
  <p>Test class:</p>
  
  <pre><code>    Currency currency = new Currency() {
          @Override
          public boolean equals(Object obj) {
              return super.equals(obj);
          }
      };
  
     Currency currency1 = new Currency() {
          @Override
          public boolean equals(Object obj) {
              return super.equals(obj);
          }
      };      
  
      currency.setAb("SE3421");
      currency1.setAb("SE3421");
      assertFalse(currency.equals(currency1));
      assertTrue((currency1.getAb()).equals(currency.getAb()));   
  </code></pre>
  
  <p>Any help is appreciated.</p>