title: How to test abstract class in Java with JUnit?
body: <p>I am new to Java testing with JUnit. I have to work with Java and I would like to use unit tests.</p>
  
  <p>My problem is: I have an abstract class with some abstract methods. But there are some methods which are not abstract. How can I test this class with JUnit? Example code (very simple):</p>
  
  <pre><code>abstract class Car {
  
      public Car(int speed, int fuel) {
          this.speed = speed;
          this.fuel = fuel;
      }
  
      private int speed;
      private int fuel;
  
      abstract void drive();
  
      public int getSpeed() {
          return this.speed;
      }
  
      public int getFuel() {
          return this.fuel;
      }
  }
  </code></pre>
  
  <p>I want to test <code>getSpeed()</code> and <code>getFuel()</code> functions.</p>
  
  <p>Similar question to this problem is <a href="https://stackoverflow.com/questions/3604721/how-to-test-a-method-in-an-abstract-class-with-abstract-methods">here</a>, but it is not using JUnit.</p>
  
  <p>In JUnit FAQ section, I found <a href="http://c2.com/cgi/wiki?AbstractTestCases" rel="noreferrer">this link</a>, but I don't understand what the author want to say with this example. What does this line of code mean?</p>
  
  <pre><code>public abstract Source getSource() ;
  </code></pre>