I'm attempting to convert a diff on two lists of Entities into a more human readable format by interpreting container changes (v1.6.0).
If I have a List of Entities (listBefore):
entity1
entity2
entity3
entity4
and I reorder the list (listAfter)
entity1
entity4
entity2
entity3
The result of comparing these lists using
Javers.compareCollections( listBefore, listAfter, Entity.class )
is:
containerChanges:[(3).removed:'entity4', (1).added:'entity4']
From this I can deduce that: entity4 moved from index 3 to index 1.
If I repeat the same comparison, this time adding a new item to the second list:
entity1
entity4
entity2
entity3
entity5
the result of the comparison is:
containerChanges:[(3).'entity4'>>'entity5', (1).added:'entity4']
This seems to have missed the fact that 'entity5' was added at index (4) (i.e. not 3) and 'entity4' moved as in the previous example.
Update: I am using the Levenshtein comparator in the above examples.
Any clarification would be appreciated.