changing lang from java to scala