Update Generator.java
Update Generator.java

Simplify condition checking into waitForNext() as boolean return. Either could get next or couldn't, caller doesn't need to care if producer finished.
mherrmann/java-generator-functions