title: Test actors: receive exactly N messages
body: <p>I'm testing an application with Akka actors. I'm using Test probes. I want to verify that the probe receives EXACTLY 10 messages of the same type. One solution could be to write 10 times: </p>
  
  <pre><code>probe.expectMsg(20 seconds, Done)
  </code></pre>
  
  <p>But I would prefer a more general solution (for example I'd test my application also for n=100).
  I also tried probe.receiveN(10, 20 seconds) but if I receive more than 10 elements the test doesn't fail. Instead I want it to fail in this case. Is there a solution?</p>