Answer javadocs correction

So a developer can just copy and paste code from javadocs' snippet to have the expected result.