convert java file to scala