class NotificationPresenter {

    public void setup(final Message message) {
        checkNotNull("message",
                     message);

        final NotificationType notificationType = toNotificationType(message.getSeverity());
        if (notificationType.equals(NotificationType.OK)) {
            view.setupOk();
        } else {
            if (message.getMessages().isEmpty()) {
                view.setup(notificationType,
                           "0");
            } else {
                final StringBuilder sb = new StringBuilder();
                int i = 0;
                for (final String msg : message.getMessages()) {
                    if (!msg.trim().isEmpty()) {
                        i++;
                        sb.append(i).append(": ").append(msg).append('\n');
                    }
                }
                view.setup(notificationType,
                           String.valueOf(i),
                           clean(sb));
            }
        }
    }

    @Inject public  NotificationPresenter(final View view);

}