Declare a public class BothWays
providing one static method create
.
create
takes a single String
parameter and returns an anonymous object that implements the IBothWays
interface:
So, for example:
If the String
passed to create
is null
, throw an IllegalArgumentException
.
You're challenge is to write tests for this problem described above.
Stuck? You may find these lessons helpful: