Add checkstyle configuration and fix warnings.