title: Testing abstract classes with arguments on constructor
body: <p>I'm trying to learn about tests but I'm facing some problems whilst testing abstract classes. I know I could create a concrete subclass that inherit from Dog, like ConcreteDog, but if I add a new abstract method to Dog, I would have to add a empty method to ConcreteDog so. That would not be so cool I guess.</p>
  
  <pre><code>public abstract class Dog {
    private final int id;
  
    public Dog(int id) {
      this.id = id;
    }
  
    public int getId() {
      return id;
    }
  
    public abstract void makeSound();
  }
  
  ...
  
  public class DogTest {
    @Test
    public void testGetId() {
      int id = 42;
  
      // How to pass id to Dog constructor ?
      Dog dog = Mockito.mock(Dog.class, Mockito.CALL_REAL_METHODS);
  
      assertTrue(dog.getId() == id);
    }
  }
  </code></pre>
  
  <p>What I'm trying to do is somehow call the Mock with the constructor, like</p>
  
  <pre><code>Mockito.mock(Dog(id).class, Mockito.CALL_REAL_METHODS);
  </code></pre>
  
  <p>I don't know if it's possible with mockito, but there is a way of doing that using mockito or another tool ?</p>