In this blog I will demonstrate designing a usecase with Test First Development approach. Let me explain the usecase first, we need to write an application, where we need to recommend a user some products based on his past purchase history, in which he has similar brands. Get the working code from Github.
If you see in the above usecase, there are 3 objects, User, Item object, and UserItemPurchaseHistory. Refer @ http://krishnasblog.com/2012/09/19/designing-a-simple-usecase-using-test-first-approach-using-spring/