anchor.diff:  - From there the click event can be propagated in many ways, but I like Java 8 so let’s
   define a functional interface MessageClickListener.
   
  +[source, java]
  +----
       @FunctionalInterface
       interface MessageClickListener {
           public void messageClick(MessageComponent source, Message message);
       }
  +----
   
   Add MessageClickListener parameter to the constructor and call the listener in LayoutClickListener.
   
  -
  +[source, java]
  +----
       public MessageComponent(Message message,
               MessageClickListener clickListener) {
           // … 
           addLayoutClickListener(
                   event -> clickListener.messageClick(this, message));
       }
  +----
   
   - Fix the FolderView message population to include this new MessageClickListener. So instead of 
   MessageComponent::new call this::createFromEntity.
   
  +[source, java]
  +----
       private void refreshFolder(String folder) {
           removeAllComponents();
           messageFacade.getFolderMessages(folder).stream()
  
positive.code:     // …
      // getters and setters skipped for brevity
  }
  
  === Repository
  With DeltaSpike, defining a repository is very simple. In this sample I just extended EntityRepository and added the needed methods. The EntityRepository has already the basic CRUD methods, and I only needed to add my custom methods there. The methods use DeltaSpike’s automatically generated query implementations by naming conventions.
  
  @Repository
  public interface MessageRepository extends EntityRepository<Message, Long> {
      QueryResult<Message> findByRead(boolean read);
  
negative.code: 
      List<Message> findByFlagIsNotNullAndTrashed(boolean trashed);
  }
  ----
  
  === Facade
  A simple stateless EJB facade accessing repositories. Inject your repository to the facade.
  
  [source, java]
  ----
  @Stateless
  public class MessageFacade {
  
  