Tip: Be wary of something working on the first try.
If something works on the first try, it’s guaranteed to be screwed up in some way.
A common one for me, as it’s easy to forget, is enabling Java’s assertions. They’re disabled by default and if you use an IDE’s fancy doo-dads to automatically run your JUnit tests then it wont have the assertions enabled (you typically have to manually enable them). All shows green and you move on. At some point later you hit an NPE (
NullPointerException — the bane of a Java programmer’s existance) and see that there is an assertion in place. Then you realize that you never enabled assertions. A forhead smack occurs and you spend a day debugging what you should have fixed in the first place (when it was fresh in your mind).