title: How to test that all methods of a class is not called in jMock?
body: <p>Using jMock, how do I test that all methods of a certain class is not called upon invoking a method in another class?</p>
  
  <p>For example, if I have class <code>A</code> and class <code>B</code>:</p>
  
  <pre><code>class A {
      void x() {
      }
      void y() {
      }
      void z() {
      }
  }
  
  class B {
      A a;
      void doNothing() {
      }
  }
  </code></pre>
  
  <p>How do I test that the invocation of <code>B#doNothing()</code> doesn't invoke <em>any</em> of class <code>A</code>'s method?</p>
  
  <p>I know that with jMock 2 and JUnit 3, I can do:</p>
  
  <pre><code>public class BTest extends MockObjectTestCase {
      @Test
      public void testDoNothing() {
          B b = new B();
          A a = b.getA();
          checking(new Expectations() {{
              never(a).x();
              never(a).y();
              never(a).z();
          }});
          b.doNothing();
      }
  }
  </code></pre>
  
  <p>But what if there is more than just 3 methods, say 30? How would I test that?</p>