class EntityMetadataEvent implements Event, Comparable<EntityMetadataEvent> {

  @Override
  public int compareTo(EntityMetadataEvent o) {
    return Long.compare(timestamp, o.timestamp);
  }

}

class EntityMetadataEventTest {

   EntityMetadataEvent e1;
   EntityMetadataEvent e2;

  @Test
  public void when_EventsAreCompared_then_TheyAreOrderdByTimestamp() {

    assertEquals(-1, e1.compareTo(e2));
    assertEquals(0, e1.compareTo(e1));
    assertEquals(1, e2.compareTo(e1));
  }

}