@Override public boolean containsKey(KeyMatcher key) { return getAll(key).size() > 0; }
public KeyValuePair getUnique(KeyMatcher keyMatcher) throws NonUniqueException { KeyValuePairCollection possiblyNonUniquePairs = getAll(keyMatcher); if (possiblyNonUniquePairs.size() == 0) { return null; } if (possiblyNonUniquePairs.size() > 1) { throw new NonUniqueException("Multiple matching KeyValuePairs found for key <" + keyMatcher + ">."); } return possiblyNonUniquePairs.iterator().next(); }