package org.realityforge.replicant.client.test;

import java.util.LinkedList;
import java.util.List;
import javax.annotation.Nonnull;
import org.realityforge.replicant.client.EntityChangeEvent;
import org.realityforge.replicant.client.EntityChangeListener;

/**
 * A simple EntityChangeListener implementation that stores all the events emitted.
 */
public class CollectorEntityChangeListener
  implements EntityChangeListener
{
  private final LinkedList<EntityChangeEvent> _entityAddedEvents = new LinkedList<>();
  private final LinkedList<EntityChangeEvent> _entityRemovedEvents = new LinkedList<>();
  private final LinkedList<EntityChangeEvent> _attributeChangedEvents = new LinkedList<>();
  private final LinkedList<EntityChangeEvent> _relatedAddedEvents = new LinkedList<>();
  private final LinkedList<EntityChangeEvent> _relatedRemovedEvents = new LinkedList<>();

  @Override
  public void entityAdded( @Nonnull final EntityChangeEvent event )
  {
    _entityAddedEvents.add( event );
  }

  @Override
  public void entityRemoved( @Nonnull final EntityChangeEvent event )
  {
    _entityRemovedEvents.add( event );
  }

  @Override
  public void attributeChanged( @Nonnull final EntityChangeEvent event )
  {
    _attributeChangedEvents.add( event );
  }

  @Override
  public void relatedAdded( @Nonnull final EntityChangeEvent event )
  {
    _relatedAddedEvents.add( event );
  }

  @Override
  public void relatedRemoved( @Nonnull final EntityChangeEvent event )
  {
    _relatedRemovedEvents.add( event );
  }

  public LinkedList<EntityChangeEvent> getEntityAddedEvents()
  {
    return _entityAddedEvents;
  }

  public List<EntityChangeEvent> getEntityRemovedEvents()
  {
    return _entityRemovedEvents;
  }

  public List<EntityChangeEvent> getAttributeChangedEvents()
  {
    return _attributeChangedEvents;
  }

  public List<EntityChangeEvent> getRelatedAddedEvents()
  {
    return _relatedAddedEvents;
  }

  public List<EntityChangeEvent> getRelatedRemovedEvents()
  {
    return _relatedRemovedEvents;
  }
}

@@ -1517,24 +1517,35 @@
 ent );%0A  %7D%0A%0A
+  @Nonnull%0A
   public Lin
@@ -1586,32 +1586,32 @@
 tyAddedEvents()%0A
-
   %7B%0A    return _
@@ -1626,32 +1626,43 @@
 dedEvents;%0A  %7D%0A%0A
+  @Nonnull%0A
   public List%3CEn
@@ -1737,32 +1737,43 @@
 vedEvents;%0A  %7D%0A%0A
+  @Nonnull%0A
   public List%3CEn
@@ -1854,32 +1854,43 @@
 gedEvents;%0A  %7D%0A%0A
+  @Nonnull%0A
   public List%3CEn
@@ -1971,16 +1971,27 @@
 s;%0A  %7D%0A%0A
+  @Nonnull%0A
   public

Add some nullability annotations