title: Check that a method is not invoked
body: <p>I want to check that a method is not run and tried to do it with an Expectation setting <code>times = 0;</code>, however I don't get the expected behaviour.</p>
  
  <p>For example, the following test passes, although the <code>Session#stop</code> method is called, and the expectation has a <code>times = 0;</code> condition:</p>
  
  <pre><code>public static class Session {
      public void stop() {}
  }
  
  public static class Whatever {
      Session s = new Session();
      public synchronized void method() {
          s.stop();
      }
  }
  
  @Test
  public void testWhatever () throws Exception {
      new Expectations(Session.class) {
          @Mocked Session s;
          { s.stop(); times = 0; } //Session#stop must not be called
      };
      final Whatever w = new Whatever();
      w.method(); // this method calls Session#stop =&gt; the test should fail...
                  // ... but it passes
  }
  </code></pre>
  
  <p>Note: If I replace the code with <code>{ s.stop(); times = 1; }</code>, the test passes too: I must be missing something obvious here...</p>