saved old java8 code, switching to scala