// Path: src/main/java/com/github/sleroy/junit/mail/server/events/DeleteAllMailEvent.java
// public class DeleteAllMailEvent {
// 
// }
// 
// Path: src/main/java/com/github/sleroy/junit/mail/server/events/NewMailEvent.java
// public class NewMailEvent {
// 
//     private final EmailModel model;
// 
//     /**
//      * Instantiates a new new mail event.
//      *
//      * @param model
//      *            the model
//      */
//     public NewMailEvent(final EmailModel model) {
// 	this.model = model;
// 
//     }
// 
//     public EmailModel getModel() {
// 	return model;
//     }
// 
// }
// 
// Path: src/main/java/com/github/sleroy/junit/mail/server/events/RejectedMailEvent.java
// public class RejectedMailEvent {
// 
//     private final EmailModel model;
// 
//     /**
//      * Instantiates a new rejected mail event.
//      *
//      * @param model
//      *            the model
//      */
//     public RejectedMailEvent(final EmailModel model) {
// 	this.model = model;
// 
//     }
// 
//     public EmailModel getModel() {
// 	return model;
//     }
// 
// }


import java.util.ArrayList;
import java.util.List;
import java.util.Observable;
import java.util.Observer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.github.sleroy.junit.mail.server.events.DeleteAllMailEvent;
import com.github.sleroy.junit.mail.server.events.NewMailEvent;
import com.github.sleroy.junit.mail.server.events.RejectedMailEvent;
	LOGGER.info("A mail has been rejected : {}", mail);
	rejectedMails.add(mail);

    }

    /**
     * Save the mail.
     *
     * @param email
     *            the email
     */
    public void saveMail(final EmailModel email) {
	LOGGER.info("Has received mail : {}", email);
	emailModels.add(email);
    }

    @Override
    public String toString() {
	return "MailServerModel [emailModels=" + emailModels + ", rejectedMails=" + rejectedMails + "]";
    }

    /*
     * (non-Javadoc)
     *
     * @see java.util.Observer#update(java.util.Observable, java.lang.Object)
     */
    @Override
    public void update(final Observable o, final Object arg) {
	if (arg instanceof NewMailEvent) {
	    saveMail(((NewMailEvent) arg).getModel());
// Path: src/main/java/com/github/sleroy/junit/mail/server/events/DeleteAllMailEvent.java
// public class DeleteAllMailEvent {
// 
// }
// 
// Path: src/main/java/com/github/sleroy/junit/mail/server/events/NewMailEvent.java
// public class NewMailEvent {
// 
//     private final EmailModel model;
// 
//     /**
//      * Instantiates a new new mail event.
//      *
//      * @param model
//      *            the model
//      */
//     public NewMailEvent(final EmailModel model) {
// 	this.model = model;
// 
//     }
// 
//     public EmailModel getModel() {
// 	return model;
//     }
// 
// }
// 
// Path: src/main/java/com/github/sleroy/junit/mail/server/events/RejectedMailEvent.java
// public class RejectedMailEvent {
// 
//     private final EmailModel model;
// 
//     /**
//      * Instantiates a new rejected mail event.
//      *
//      * @param model
//      *            the model
//      */
//     public RejectedMailEvent(final EmailModel model) {
// 	this.model = model;
// 
//     }
// 
//     public EmailModel getModel() {
// 	return model;
//     }
// 
// }


// Path: src/main/java/com/github/sleroy/fakesmtp/model/MailServerModel.java
import java.util.ArrayList;
import java.util.List;
import java.util.Observable;
import java.util.Observer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.github.sleroy.junit.mail.server.events.DeleteAllMailEvent;
import com.github.sleroy.junit.mail.server.events.NewMailEvent;
import com.github.sleroy.junit.mail.server.events.RejectedMailEvent;

	LOGGER.info("A mail has been rejected : {}", mail);
	rejectedMails.add(mail);

    }

    /**
     * Save the mail.
     *
     * @param email
     *            the email
     */
    public void saveMail(final EmailModel email) {
	LOGGER.info("Has received mail : {}", email);
	emailModels.add(email);
    }

    @Override
    public String toString() {
	return "MailServerModel [emailModels=" + emailModels + ", rejectedMails=" + rejectedMails + "]";
    }

    /*
     * (non-Javadoc)
     *
     * @see java.util.Observer#update(java.util.Observable, java.lang.Object)
     */
    @Override
    public void update(final Observable o, final Object arg) {
	if (arg instanceof NewMailEvent) {
	    saveMail(((NewMailEvent) arg).getModel());
	} else if (arg instanceof DeleteAllMailEvent) {