Add a precondition test, fix a checkstyle warning