ObMimic is a library of plain-Java implementations of the Servlet API’s interfaces and abstract classes. It provides a comprehensive set of ready-made and fully-configurable test-doubles for accurately simulating the Servlet API in out-of-container testing of Servlets, Filters, Listeners and any other code that uses the Servlet API.
If you want to test code that uses the Servlet API but find that detailed testing of such code is harder, more restrictive or slower than for normal Java code - or even if you just want the simplest possible way for your tests to obtain fully-functional instances of Servlet API interfaces - ObMimic may be what you're looking for.
For full details, features, "Getting Started" and "How To" guides, Javadoc and other documentation see the OpenBrace website.
The "Community" edition of ObMimic is available for both personal and commercial use at no cost. For a free copy, go to the OpenBrace website's download page.