test a java method in netbeans : <p>Let's say I found this piece of code and I want to test it in Netbeans before I incorporate it:</p>

<pre><code>ArrayList list; 
for(String s: list)
{
    Integer c = stringsCount.get(s);
    if(c == null) c = new Integer(0);
    c++;
    stringsCount.put(s,c);
}
</code></pre>

<p>Is there a way to test the above code in Netbeans without having to create a temp class with a main? I believe there is a way in Eclipse but I am looking for a way in Netbeans. Thank you.</p>
