Add samples from the wiki docs.
Fix up javadocs, align with the Wiki.