Simplify literal-first AssertJ size assertions to hasSize
MSALReplace assertThat(<int literal>).isEqualTo(collection.size()) style assertions with the dedicated assertThat(collection).hasSize(<int literal>). Only the structural size form is rewritten, where the comparison is on a primitive int and reversing the assertion is behavior-preserving (unlike arbitrary isEqualTo object comparisons, which rely on equals).
org. openrewrite. java. testing. assertj. SimplifyHasSizeFromIsEqualToAssertionmod run . --recipe= org. openrewrite. java. testing. assertj. SimplifyHasSizeFromIsEqualToAssertionInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.