Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
No offense, but I have to say that class is a mess. First of all, you use a lot of formatting + parsing to get rid of the day, just to set it afterwards. Second, your getLastDay method does not take into account daylight savings time, when one day can have 23 hours instead of 24. Thirdly, your if-statement in the last method is just nasty. A switch would have made more sense:
That said, all your methods could have been written using only Date and Calendar; no formatting and re-parsing, just the final formatting:
Not only is it shorter (1 line each for the first two methods, and don't get me started on the last one), it is also more robust (the daylight savings time thingy, Calendar has proven itself*) and easier to understand.
* A lot of people recommend using Joda time over Calendar. I feel that their motivations are more based on usability than Calendar not working.
And don't be hard done by my comments. I've written code a lot worse than that even during the latter stages of getting my degree The thing is, you learn by practice and experience, and from corrections by others. I still learn new methods and classes in the API quite regularly.