title: Mockito Spy - stub before calling the constructor
body: <p>I'm trying to spy on an Object and I want to stub a method that is called by the constructor before the constructor calls it.<br>
  My class looks like that:</p>
  
  <pre><code>public class MyClass {
      public MyClass() {
           setup();
      }
  
      public void setup() {
  
      }
  }
  </code></pre>
  
  <p>The setup method mustn't be called. Well, how do I spy on this method (and stub setup so that it does nothing)?<br>
  It works fine with mocking the method but I want to unit test <code>MyClass</code> and so I will need very other method.  </p>
  
  <hr>
  
  <p>The reason why need to stub the setup method so that it does nothing:<br>
  I'm programing a Lego robot (lejos) and I put some code in setup that the robot needs to work. However, when I call it outside TinyVM (the VM that is installed on the robot), java crashes since it the VM hasn't been initialized properly (because the tests run on my PC). For unit-testing the setup isn't important.<br>
  I can't stub the classes/methods setup calls since some of them are public static final variables. </p>