ComparationEntry add to comparedEntries twice, so the second time
comparedEntries.add(new ComparationEntry(workingValue,
eventSourcedValue) will aways return false! Then it will never do
fields value compare.
private void
assertValidWorkingAggregateState(EventSourcedAggregateRoot
eventSourcedAggregate) {
HashSet<ComparationEntry> comparedEntries = new
HashSet<ComparationEntry>();
comparedEntries.add(new ComparationEntry(workingAggregate,
eventSourcedAggregate));
...
}
private void ensureValuesEqual(Object workingValue, Object
eventSourcedValue, String propertyPath,
Set<ComparationEntry>
comparedEntries) {
if (explicitlyUnequal(workingValue, eventSourcedValue)) {
...
} else if (comparedEntries.add(new
ComparationEntry(workingValue, eventSourcedValue))
&& workingValue != null && !
hasEqualsMethod(workingValue.getClass())) {
...
}
}