Univeristy assignment, Toy library in Java