title: JUnit - test that a method has been called
body: <p>I'm new to unit testing, and I'm trying to test that a method has been called. The method in question doesn't return anything.</p>
  
  <pre><code>public void example (boolean foo) {
  
      if (foo) {
          processFoo(foo);
      } 
      else if (foo==false) {
          processSomethingElse(foo);
      }
  }
  </code></pre>
  
  <p>I want to be able to test that the <code>processFoo</code> method is being called, but I don't know how to do that.</p>
  
  <p>If mocking is required, then I have to use <code>JMockit</code>. Thanks!</p>