Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java

Onur Dursun
Onur Dursun
6,532 Points

What is this onSale method?

Hello.

In the video titled "What not to test?" we are introduced to an interface created within the project, called Notifier. I did not quite get what do we need that interface for and how did we use it? Also, the interface consists of a method 'onSale'. I did not understand how do we need it?

One other thing is that when we override this 'onSale' method in our test class, why did we put return; statement inside braces? Isn't it already returns nothing(void) ?