use scala instead of java