title: How does Junit @Rule work?
body: <p>I want to  write test cases for a bulk of code, I would like to know details of JUnit <code>@Rule</code> annotation feature, so that I can use it for writing test cases. Please provide some good answers or links, which give detailed description of its functionality through a simple example.</p>