Fixed usage of java 8 only method