title: How do Java mocking frameworks work?
body: <p>This is NOT a question about which is the best framework, etc.</p>
  
  <p>I have never used a mocking framework and I'm a bit puzzled by the idea. How does it know how to create the mock object? Is it done at runtime or does it generate a file? How do you know its behavior? And most importantly – what is the workflow of using such a framework (what is the step-by-step for creating a test)?</p>
  
  <p>Can anyone explain? You can choose whichever framework you like for example, just say what it is.</p>