Design guidance for methods returning objects in java / can I use exceptions?
<p>If I have a method say <code>getNextWidget()</code> that returns a widget, what is the proper design for such a method if I need to check the size of say, the factory that makes the widget and only return a widget if there are widgets in the factory?  Is there a way to throw an exception for a method that is not <code>void</code>?</p>
