Add javadoc: `@throws IllegalStateException if times out`.