Skip to content

add containsOnce/containsAllOnce assertions #399

@wjtk

Description

@wjtk

I think that would be helpful to add two assertions for Iterables:
containsOnce(elem) - works as contains, but throws when elem occurs more than one time
containsAllOnce(vararg elements) - as above, but for list of elems (like contains/containsAll)
I've added first assertion in my project and I found it useful.

Wdyt? Can I try to make PR?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions