[java] Fix asserts for maps and sets by asolntsev · Pull Request #16808 · SeleniumHQ/selenium

@asolntsev self-assigned this

Dec 29, 2025
The problem is that AssertJ's method `isEqualTo` doesn't always work for Sets and Maps because it assumes strict order of elements:
1. `assertThat(MAP).isEqualTo(Map.of(...))`
2. `assertThat(SET).isEqualTo(Set.of(...))`

In both cases, we have to replace `isEqualTo` by `containsExactlyInAnyOrderEntriesOf` or similar method.
After the simplification, it became obvious that some of ByChainedTest tests don't really test anything. They create a bunch of lists (e.g. `elems345`) which are not used. And only the empty list of elements is loaded and asserted.

Seems that this complex/misleading test logic in ByChainedTest was
introduced in commit c4861b8 (some "patch from BenChambers"). Needs to be reviewed and fixed.

@asolntsev

now we check that the resulting content at least _looks like PDF_.

@asolntsev asolntsev deleted the fix/asserts-for-maps-and-sets branch

December 29, 2025 22:29