We run BusinessRuleTest through the JUnit extension of our
favorite IDE. If you're not familiar with JUnit, more information
can be found at JUnit's website. Not surprisingly, our test fails at the second
assertion, shown in Figure 2, as we don't (yet) have the
appropriate business logic in place. This is reassuring, as it
shows that our simulator/unit tests are highlighting the problems
that they should.

Figure 2. JUnit test results

Writing the Business Logic using Rules

At this point, we need to write some business logic that says,
"If the stock price is less than 100 Euro, then we should buy it."
To do this, we will modify BusinessLayer.java to read: