See my books:

Source code
About the Author

Questions regarding my books?
E-mail me at
About the Author
Hi there!
My name is Tomek Kaczanowski, and I’m happy to present to you the results of my hard work. My books have been written on the basis of my experience as a senior Java developer, trainer, mentor, technical team leader and merciless code reviewer. :)
The books have been proofread by several TDD, TestNG and Mockito experts, and corrected by a native speaker, so I feel pretty confident about recommending them. Okay then, let’s forget about modesty: I reckon these really are the best books dealing with unit tests on the market! I hope you’ll share my opinion - when you’ve read them! :)
Personally, I would have been really happy to have had the chance to read books like these some time ago: it would have spared me several grey hairs, for sure! :) I would also be happy if my colleagues were to read them and follow the advice they would find there... :)
You can learn more about me by reading my blog.

Source Code

There is also a README file in each project.
Bad Tests, Good Tests
Some of the code presented in the book can be found online.
Practical Unit Testing with TestNG and Mockito
All source code for exercises is now available online. Some examples are also available.
Practical Unit Testing with JUnit and Mockito
Source code for exercises and examples is available online.