Homework 2 for Java Advanced course by Korneev Georgiy