Soloutions to the book in Java