EntityMetadataEvent implements Event, Comparable<EntityMetadataEvent> { @Override public int compareTo(EntityMetadataEvent o) { return Long.compare(timestamp, o.timestamp); } private  EntityMetadataEvent(final String name, final Map<String, AttributeValue> attributes,
      final long timestamp); static EntityMetadataEvent create(final String name); static EntityMetadataEvent create(final String name,
      final Map<String, AttributeValue> attributes); static EntityMetadataEvent create(final String name, final long timestamp); static EntityMetadataEvent create(final String name,
      final Map<String, AttributeValue> attributes, final long timestamp); static EntityMetadataEvent create(final Event event); static EntityMetadataEvent create(final Event event, final long timestamp); @Override String getName(); @Override Map<String, AttributeValue> getAttributes(); @Override int compareTo(EntityMetadataEvent o);  }
@Test public void when_EventsAreCompared_then_TheyAreOrderdByTimestamp() { assertEquals(-1, e1.compareTo(e2)); assertEquals(0, e1.compareTo(e1)); assertEquals(1, e2.compareTo(e1)); }