K - Type of key.V - Type of value.public final class HasEntry<K,V> extends MatcherEnvelope<Map<K,V>>
Map has particular elements.
Here is an example how HasEntry can be used:
new Assertion<>(
"must match",
() -> new MapOf<>(
new MapEntry<>("a", 1),
new MapEntry<>("b", 2)
),
new HasEntry<>("a", 1)
).affirm();describeMismatchSafely, describeTo, matchesSafelyCopyright © 2017–2019 jcabi.com. All rights reserved.