Test sometimes fails: In an event of type [IngredientWeightChanged], the property [ingredientUUID] was not as expected

Looks really like a race condition:

org.axonframework.test.AxonAssertionError: One of the events contained
different values than expected

In an event of type [IngredientWeightChanged], the property
[ingredientUUID] was not as expected.
Expected <bc402926-8b59-4743-88fc-f795753d8209> but got

It happens approximately every second test-run. Because I expect two
events IngredientWeightChanged, I think the problem is now and then
the second Event comes first. Might be a bug with Fixture?


My Test

  new ArtisanCreated("",Guild.BAKER),
  new RecipeCreated(recipeArId, recipeNameExpected, ownerUUID),
  new IngredientInserted(ingredientUUID, name, nutsBefore ,
Allergen.False, 100),
  new IngredientInserted(ingredientUUID2, "schnaps", nutsBefore ,
Allergen.False, 100),
  new RecipeWeightChanged(nutsTot, 200))
when(new ChangeBakeLoss(recipeUUID, 100))
        new BakeLossChanged(200, 100),
  new IngredientWeightChanged(ingredientUUID, nutsAfter, 50),
  new IngredientWeightChanged(ingredientUUID2, nutsAfter, 50),
  new RecipeWeightChanged(nutsTot, 100)

Although I’m not ruling out any bugs in the fixture, are you sure that the events you generate are always in the same order?
If you use a HashMap or HashSet to store your ingredients, for example, that could explain the order difference.

Indeed it is a HashMap, but does this mean I can't use a HashMap in
the Fixture? If I don't care about the order of events, how do I use
the fixture?

I see it is a matter of matchers. Played with Hamcrest, didn't succeed
even to provide the right generics for a Matcherlist.
Will deffer this problem.