A Java8 implementation.