Fix checkstyle warnings
Add test