Best way to add validation incase a list returns null?
<p>I have the following code within my <code>Java</code> application:</p>

<pre><code> for (String s: personService.returnNames(){

       //do something
    }
</code></pre>

<p>Note: the return value of <code>returnNames()</code> is a <code>set</code> of Strings</p>

<p>How can I best <code>validate</code> this code so that even if no Strings are returned the application does not crash?</p>