Replace use of jdk 1.8 api