@Test
public void shouldFailReceiveEventWithHigherCounter() throws Exception {

  Event event = Event.started(INSTANCE);
  when(transaction.readActiveState(INSTANCE)).thenReturn(
      Optional.of(RunState.create(INSTANCE, State.SUBMITTED, StateData.zero(), NOW, 17)));
  try {
    stateManager.receive(event, 16);
    fail();
  } catch (StateTransitionConflictException ignore) {
  }
  verify(storage, never()).writeEvent(any());
}