Implement test suite for the QueryGenerator class

Fix some javadoc in the class, and modify the where methods to always
use ' (but prepared statement should always be used.
Fix failing test, and document it

The exception thrown depends if the JVM is launch with assertion check
option.