In the above scenario to solve the IllegalStateException you need to invoke the remove() method of the properly (only once after calling next()). So basically if you mean not found, well then tell me, instead of sending a null and expecting me to guess it (and please dont use the JavaDoc argument, if I need to check that to understand your interface its too complicated). I already provided a few reasons in my post. It is somewhat true that illegal state exceptions shouldnt exist as those can be, in theory, replaced by IllegalArgumentExceptions which check all possibilities for emerging illegal states. So I eventually came up with a test like this: Now, parse() can return either a failure or a success. Just like nullable types in my opinion a necessary evil for dealing with poor code/legacy code outside your control, so far the only good use case Ive seen is dealing with legacy classes without a proper interface. The valueOf() method of the java.sql.Date class accepts a String representing a date in JDBC escape format yyyy-[m]m-[d]d and converts it into a java.sql.Date object. So it is either Either.Right or Either.Left, but never both. IllegalArgumentException ? Depending on the use case the two most solutions in my experience are: That way you communicate the optional nature of things, and the reason behind it. Do you tend to stick with your guidelines for choosing or do you flex on this case? Invocation of method 'getLocale' in class com.atlassian.confluence.core.ConfluenceActionSupport threw exception java.lang.IllegalStateException: Spring Application context has not been set at.