Docs: java add static imports for query and filter builders

Also move and add inline comments to references

Closes #6920.

(cherry picked from commit cdd4d00)