changing tests to scala
piotrek's version