Prior to this commit, the "client" and "testing" sections of the
reference documentation were using inline code snippets.
Because of this, several snippets were out of date or invalid.
This commit moves all those code snippets to actual Java classes
compiled with the documentation.
Fixes gh-1042