Using TDD (Test-Driven Development) in Java to solve the prime factorization problem.
It's very happy for me to do TDD. The problem seems quite hard for me to solve when I see it the first time. It's very amazing to solve it in just less than half an hour using only several lines of code. Although it seems to make you slower writing tests, those tests proved that your code is right. They can also save your time, because you can almost throw your debugger away. After several practices at work, I've found that TDD is a highly efficient approach to develop well-structured working software.
Enjoy TDD!