=== Code examples

==== Noncompliant code example

[source,csharp,diff-id=1,diff-type=noncompliant]
----
bool ValueExists(HashSet<int> data) => 
    data.Any(x => x == 42);
----

[source,csharp,diff-id=2,diff-type=noncompliant]
----
bool ValueExists(List<int> data) => 
    data.Any(x => x == 42);
----

==== Compliant solution

[source,csharp,diff-id=1,diff-type=compliant]
----
bool ValueExists(HashSet<int> data) => 
    data.Contains(42);
----

[source,csharp,diff-id=2,diff-type=compliant]
----
bool ValueExists(List<int> data) => 
    data.Contains(42);
----
