Retrieving content from a bean without having to worry about returning a null?
<p>Suppose you have some content that is guaranteed to have some value. Your job is to find it when given something <code>like</code> it.</p>

<p><strong>This works:</strong></p>

<pre><code>public KVPair getKvpForKey(String keyValue) {
    KVPair kvpInThisContent = null;

    for (KVPair kvp : kvContent) {
        if (kvp.getKey().getAsFound().equals(keyValue)) {
            kvpInThisContent =  kvp;
            break;
        }
    }

    return kvpInThisContent;
}
</code></pre>

<p><strong>This also works:</strong></p>

<pre><code>public KVPair getKvpForKey(String keyValue) {

    for (KVPair kvp : kvContent) {
        if (kvp.getKey().getAsFound().equals(keyValue)) 
            return kvp;
    }

    return null;
}
</code></pre>

<p>But ... both assume a possibility .. that in some cases <code>null</code> may be returned. While fine, this seems sloppy, assuming we know that it is not possible (content is there!). </p>

<p>Is there a way to do it cleaner without having to worry about a <code>null</code>?</p>
