Pin JDK version in Travis.
Refactor tests.