Tasks from Yakov fain Java book