package io.caster.mockito;

public class UserRegistration {

    private Database database;

    public UserRegistration(Database database) {
        this.database = database;
    }

    public void registerNewUser(String emailAddress) throws UserAlreadyRegisteredException {
        if (database.hasUser(emailAddress)) {
            throw new UserAlreadyRegisteredException();
        }

        database.addUser(emailAddress);
    }
}
@@ -86,16 +86,562 @@
 abase;%0A%0A
+    /* this does not use Dependency Injection;%0A     *     - this class is tied to SimpleDatabase implementation%0A     *     - no other implementation of a Database can be provided, even during unit testing%0A     */%0A    public UserRegistration() %7B%0A        this.database = new SimpleDatabase();%0A    %7D%0A%0A    /* this uses Dependency Injection;%0A     *     - the database is given to this method%0A     *     - this method doesn't have to worry about fetching the database reference%0A     *     - alternative database implementations can be provided%0A     */%0A
     publ

update UserRegistration to have two constructors