Skip to content

[COLLECTIONS-898] AbstractSetTest cannot be used with an explicitly typed Set (unless it's based on String) - #727

Merged
garydgregory merged 1 commit into
apache:masterfrom
tmortagne:COLLECTIONS-898-typed-AbstractSetTest
Aug 25, 2026
Merged

[COLLECTIONS-898] AbstractSetTest cannot be used with an explicitly typed Set (unless it's based on String)#727
garydgregory merged 1 commit into
apache:masterfrom
tmortagne:COLLECTIONS-898-typed-AbstractSetTest

Conversation

@tmortagne

@tmortagne tmortagne commented Aug 17, 2026

Copy link
Copy Markdown
Member

Pick a valid element from getFullElements(), instead of adding a hardcoded String.

I did not dare making more changes to the logic of that test, but I'm honestly not sure there is that much value in the "Empty set shouldn't equal nonempty set" bit, compared to the "Sets with different contents shouldn't be equal" one at the end. I mean it's not really the point of this test to validate the #add vs #addAll APIs behaviors.

There does not seem to already exist a test class designed specifically to validate AbstractSetTest behavior (but there are various test classes which rely on AbstractSetTest), so I did not create a new one for such a small change. But I may have missed it.

Thanks for your contribution to Apache Commons! Your help is appreciated!

Before you push a pull request, review this list:

  • Read the contribution guidelines for this project.
  • Read the ASF Generative Tooling Guidance if you use Artificial Intelligence (AI).
  • I used AI to create any part of, or all of, this pull request. Which AI tool was used to create this pull request, and to what extent did it contribute?
  • Run a successful build using the default Maven goal with mvn; that's mvn on the command line by itself.
  • Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied. This may not always be possible, but it is a best practice.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Each commit in the pull request should have a meaningful subject line and body. Note that a maintainer may squash commits during the merge process.

@garydgregory

Copy link
Copy Markdown
Member

Jira ticket is COLLECTIONS-898.

@tmortagne

tmortagne commented Aug 19, 2026

Copy link
Copy Markdown
Member Author

Hmm, indeed sorry about that bad copy/paste. Fixed.

@tmortagne tmortagne changed the title [COLLECTIONS-123] AbstractSetTest cannot be used with an explicitly typed Set (unless it's based on String) [COLLECTIONS-898] AbstractSetTest cannot be used with an explicitly typed Set (unless it's based on String) Aug 19, 2026
…yped Set (unless it's based on String)

* pick a valid element from getFullElements() instead of adding an hardcoded String
@tmortagne
tmortagne force-pushed the COLLECTIONS-898-typed-AbstractSetTest branch from 284e123 to 5ab3ea7 Compare August 19, 2026 13:03
@garydgregory
garydgregory merged commit 188af48 into apache:master Aug 25, 2026
11 checks passed
garydgregory added a commit that referenced this pull request Aug 25, 2026
@garydgregory

Copy link
Copy Markdown
Member

@tmortagne Thank you, merged 🚀

@tmortagne

Copy link
Copy Markdown
Member Author

Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants